【发布时间】:2014-04-10 00:53:53
【问题描述】:
我希望能够使用 ',' 作为分隔符拆分字符串,并且只修剪结果拆分两侧的空白。例如:
string str = "The, quick brown, fox";
string[] splitsWithTrim = str.split(',', also trim whitespace somehow?);
foreach (string s in splitsWithTrim)
Console.WriteLine(s);
//output wanted:
//The
//quick brown
//fox
【问题讨论】:
标签: c# string split removing-whitespace