Dim DirtySample As String = "The quick brown fox " & ControlChars.CrLf & " jumped" & ControlChars.Tab & ControlChars.Tab & " over lazy dog"
Dim CleanSample As String = System.Text.RegularExpressions.Regex.Replace(DirtySample, "\s+", " ")
Debug.WriteLine("DirtySample : ")
Debug.WriteLine(DirtySample)
Debug.WriteLine("CleanSample : ")
Debug.WriteLine(CleanSample)
Output
DirtySample :
The quick brown fox
jumped over lazy dog
CleanSample :
The quick brown fox jumped over lazy dog
No comments:
Post a Comment