如何提取字符串中除空格外的字符
例如要截取“RC CCH BR ROUTING”,要把“RC”、“CCH”、“BR”、“ROUTING”截出来,除了用MID函数外,还有什么办法?
[解决办法]
Split
[解决办法]
str=Regex.Relace("RC CCH BR ROUTING",@"\s+","")
[解决办法]
try...
Dim test As String = "RC CCH BR ROUTING"Dim result As String() = test.Split(New Char() {" "c}, StringSplitOptions.RemoveEmptyEntries)For Each s As String In result Console.WriteLine(s)NextConsole.ReadLine()