C# 分割含有回車字符的方法
當(dāng)前位置:點(diǎn)晴教程→知識(shí)管理交流
→『 技術(shù)文檔交流 』
1、直接分割
string[] method1 = text1.Split(new string[] { "\r\n" }, StringSplitOptions.RemoveEmptyEntries); 2、正則分割 Regex re = new Regex(@"\r\n"); string[] method2= re.Split(text2); 3、替換后分割 例如替換成@ text3=text3.Replace ("\r\n","@"); method3 = text3.Split('@');
該文章在 2021/1/28 16:25:46 編輯過 |
關(guān)鍵字查詢
相關(guān)文章
正在查詢... |