프로그래밍/ㄴ기타
[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
반응형