What third party string manipulation classes should I use, if any? How should I go about remove every instance of " " (I think they are called whitespaces) in a string?
Thanks
What third party string manipulation classes should I use, if any? How should I go about remove every instance of " " (I think they are called whitespaces) in a string?
Thanks
replaceAll changes all instances
I have my M_String module available at my web site with tons of string manipulation code.
You can use ReplaceAll to remove spaces:
result = aString.ReplaceAll( " ", "" )
If you truly mean any whitespace (spaces, tabs, or newlines), you’re better off using a regular expression:
dim rx as new RegEx
rx.SearchPattern = "\\s"
rx.Options.ReplaceAllMatches = true
result = rx.Replace( aString )
[quote=56869:@Kem Tekinay]I have my M_String module available at my web site with tons of string manipulation code.
You can use ReplaceAll to remove spaces:
result = aString.ReplaceAll( " ", "" )
If you truly mean any whitespace (spaces, tabs, or newlines), you’re better off using a regular expression:
[code]
dim rx as new RegEx
rx.SearchPattern = “\s”
rx.Options.ReplaceAllMatches = true
result = rx.Replace( aString )
[/code][/quote]
Thanks