There is no intrinsic String method in .NET that would do that so it will have to be synthesised and as they are String operations it is very nearly as efficient when optimised compiled Basic4ppc as when doing it in a library.
Code:
Sub MergeWhiteSpaces(str)
str = StrReplace(str, Chr(8), " ")
Do
Len1 = StrLength(str)
str = StrReplace(str, " ", " ") ' replace two spaces by one
Loop Until Len1 = StrLength(str)
Return str
End Sub
You could also use a StringBuilder, iterate the original string with StrAt and append the required characters to the StringBuilder. As the .NET string replace is probably optimised assembly code I would first try using that as I suspect that might be at least as fast unless the loop has to run several times for long lengths of whitespace.