Function unQuoteString(str, quot) Dim res : res = Trim(str) if Left(res,1) & Right(res,1) = quot & quot Then res = MID(res,2, LEN(res)-2) unQuoteString = res End Function '== EXAMPLE == myString = """" & "Hello World!" & """" wscript.echo "Before: " & myString '-> Before: "Hello World" wscript.echo "After: " & unQuoteString(myString,"""") '-> After: Hello World '
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 : unQuoteString()
This small function removes the quotes from a quoted string (or any two identical characters that "wraps" a string)
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment