본문 바로가기

반응형
Notice
Recent Posts
Recent Comments
Link
«   2025/08   »
1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31
Archives
Total
Today
Yesterday
관리 메뉴

[Unity] 문자열에서 개행 문자열 제거한 값 얻기 본문

프로그래밍/ㄴ기타

[Unity] 문자열에서 개행 문자열 제거한 값 얻기

최갓 2019. 11. 13. 18:29
반응형

코드 원문 : 

public static class StringExtensions
{
    public static string RemoveNewLine( this string self )
    {
        return self.Replace( "\r", "" ).Replace( "\n", "" );
    }
}

 

사용법:

var str = "피카츄 \n망나뇽" ; 
str = str.RemoveNewLine ();

 

참고:

http://www.atmarkit.co.jp/fdotnet/dotnettips/1000removecrlf/removecrlf.html

반응형
Comments