가 어떻게 포맷 문자열내가 가지고 어떻게하는 방법을 여러 줄에 일반 문자열을 변환 문자열
다음 문자열에 문자열을 변환 할 수 있습니다
내가 변환해야
"It was the best of times, it was the worst of times, it was the age of wisdom, it was the age of foolishness, it was the epoch of belief, it was the epoch of incredulity, it was the season of Light, it was the season of Darkness, it was the spring of hope, it was the winter of despair, we had everything before us, we had nothing before us"
위의 문자열은 다음과 같습니다.
"It was the best of times, it was the worst of times,\\n" +
" it was the age of wisdom, it was the age of foolishness,\\n" +
" it was the epoch of belief, it was the epoch of incredulity,\\n" +
" it was the season of Light, it was the season of Darkness,\\n" +
" it was the spring of hope, it was the winter of despair,\\n" +
" we had everything before us, we had nothing before us";
흠 같이 Environment.NewLine 속성을 사용합니다 - 그냥 기본을 : 참조 : 대부분의 언어는 '분할()'명령을 제공합니다 - 또는'replace()'를 사용하여 보통의 줄 바꿈 (\ n)을''\ n "'으로 바꾸십시오. – Najzero
이것은 대개 텍스트 편집기를 사용하여 수행되며 대부분 고급 항목은 regexp 찾기/바꾸기를 지원합니다 및 매크로. –
@ Najzero 덕분에 나는 .replace ("\ n", "\\ n"); 하지만 제대로 웍을 –