用正則表示式取代。
正則表示式:"\s+"
注意反斜線!

程式範例:(C#)

string result = Regex.Replace(XML, @"\s+", "");

 

參考:Efficient way to remove ALL whitespace from String?

 

arrow
arrow

    Robert 發表在 痞客邦 留言(0) 人氣()