Function removeExtraSpaces(str) Dim res Dim re : set re = New RegExp re.Global = True re.Pattern = "\s+" removeExtraSpaces = re.Replace(str," ") End Function '== EXAMPLE == myString = " A lot of space" wscript.echo removeExtraSpaces(myString) '-> A lot of space '
A diary of a newbie's wild adventure through the world of low-level scripting and computer programming. Flash Actionscript, VBScript, Windows Commandline Scripting, Data Visualization - JOY!
Thursday, December 22, 2011
VBScript : removeExtraSpaces()
This function uses VBScript RegExp to find and remove unwanted/superflous spaces in a string.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment