String Replace Cmd

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
User avatar
CyberCitizen
Automation Wizard
Posts: 721
Joined: Sun Jun 20, 2004 7:06 am
Location: Adelaide, South Australia

String Replace Cmd

Post by CyberCitizen » Fri Nov 11, 2005 4:30 am

String Replace Cmd.

StringReplace>sourcestring,find,replace,newstring

What I Am Trying To Do Is Replace The ,'s In A Set Of Numbers.

Eg The Numbers Are Listed 58,452,197

What I Want To Be Able To Do Is Replace The ,'s With Nothing.

The Stand Way Does Not Work As It Treats The Commas As A Seperator.

StringReplace>sourcestring,find,replace,newstring
StringReplace>58,452,197,,,,NewNumber
FIREFIGHTER

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Fri Nov 11, 2005 4:57 am

Try the following (untested)
--------------------------------------

Let>Source=58,452,197
Let>Find=,
StringReplace>%Source%,%Find%,,NewNumber
MessageModal>New Number is %NewNumber%
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

Me_again
Automation Wizard
Posts: 1101
Joined: Fri Jan 07, 2005 5:55 pm
Location: Somewhere else on the planet

Post by Me_again » Fri Nov 11, 2005 5:24 am

Shamelessly stealing the idea from a post by support I can reveal that it's very easy with vbscript

VBSTART
VBEND
..
Let>oldnum=111,222,333
VBEval>Replace("%oldnum%",",",""),newnum
MessageModal>newnum

User avatar
support
Automation Wizard
Posts: 1450
Joined: Sat Oct 19, 2002 4:38 pm
Location: London
Contact:

Post by support » Fri Nov 11, 2005 8:04 am

As Bob suggests, if you ever need to pass a comma as a parameter just make a variable for it first:

Let>comma=,
StringReplace>string,comma,replace,newstring

This works whichever command you need to use.
MJT Net Support
[email protected]

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts