看板 C_Sharp 關於我們 聯絡資訊
請教一個問題 一個字串中包含\n 將字串顯示在richTextBox上會直接秀出\n出來 要怎樣才能讓\n變成newline呢? 抱歉沒說很清楚 我是讀取txt文字檔 文字檔中有\n字串 讀檔的時候直接把\n當作一般字串 所以顯示出來會變成test\ntest2 可是我想顯示成 test test2 -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 211.74.12.229
horngsh:\r\n or ? 01/10 16:59
※ 編輯: ashram 來自: 211.74.12.229 (01/10 17:04)
remmurds:如果要換行的話 建議使用Environment.NewLine 01/10 19:12
senjor:richtextbox.text.replace("\\n","\n") 01/11 13:40