replacement in variables

 2 Replies
 0 Subscribed to this topic
 52 Subscribed to this forum
Sort:
Author
Messages
TommyT
Veteran Member Send Private Message
Posts: 58
Veteran Member

I need to strip a variable of certain characters (& / \ etc).  I'm using the replace method like this

wname=qryPL.replace("&","")
wname=wname.replace("',"")
wname=wname.replace("/","")

The only replacement that works is whichever character I place in the first_ line.  Once I'm acting on the variable wname it doesnt work.  I can change the characters to be replaced around and only the one in the first line works.

Is there something different I need when acting on the vairiable?
John Henley
Send Private Message
Posts: 3351
Did you try ?
wname=qryPL.replace("&","").replace("',"").replace("/","")

Thanks for using the LawsonGuru.com forums!
John
TommyT
Veteran Member Send Private Message
Posts: 58
Veteran Member
Worked great. Thanks!