Sub LTrim(s As String) As String
Dim m As Matcher = Regex.Matcher("^(\s+)", s)
If m.Find Then
Return s.SubString(m.GetEnd(1))
Else
Return s
End If
End Sub
Sub RTrim(s As String) As String
Dim m As Matcher = Regex.Matcher("(\s+)$", s)
If m.Find Then
Return s.SubString(m.GetEnd(1))
Else
Return s
End If
End Sub