Posts Tagged "Replace All"

How to do ‘replaceall’ in VBScript?

Posted by on Nov 13, 2010 in VBScript | 1 comment

As you might know the vbscript replace function does always search only “one round”. Here is an example, what exactly I mean: Lets assume you want to correct the following string by replacing all “double-l’s” by “single-l’s”: str = "Littllllle worllllllld!" The code would be: wscript.echo replace(str, "ll", "l") But everything this line does is replace all existing “ll” by “l”. So lets have a look what’s left – the output is: Litllle worlllld! Why? The original string contained 5 l in Little and 7 l in world....

Read More