Reputation: 1159
I use a vbs variable that contains a large string. This string holds on many lines and some of these lines begin with one or more spaces. I need to delete all spaces at beginning of each line in my variable. To do that, I use a regular expression such as ^\s+, but it only ignores spaces at begin of string and not in all lines as part of my variable. Please could you please, help me with something that do it?
Thank you in advance
Upvotes: 0
Views: 94
Reputation: 2801
The variable holds a string that contains line break characters, is that? if it is, try setting the property Multiline of the RegExp to true.
From: http://www.xaprb.com/blog/2005/11/04/vbscript-regular-expression-gotchas/
(You could also split each line into an array and do the Regex on a loop on each)
Upvotes: 1