Link to home
Create AccountLog in
Avatar of Mike_Stevens
Mike_StevensFlag for United States of America

asked on

Search string and replace characters

I need to search a string value and replace predefined characters.  As an example:

I need to replace @, %, & with an X in the following string value

34@Mnkee%ssss&kpoilops@gghh

I am sure this can be done but and not sure how to do it.


Avatar of Daniel Reynolds
Daniel Reynolds
Flag of United States of America image

the following should do it.

mystring = mystring.Replace("@", "X").Replace("%","X").Replace("&","X")
ASKER CERTIFIED SOLUTION
Avatar of zstapic
zstapic
Flag of Croatia image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account