Avatar of Mike_Stevens
Mike_Stevens
Flag 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.


Visual Basic.NETMicrosoft Development

Avatar of undefined
Last Comment
zstapic

8/22/2022 - Mon
Daniel Reynolds

the following should do it.

mystring = mystring.Replace("@", "X").Replace("%","X").Replace("&","X")
ASKER CERTIFIED SOLUTION
zstapic

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Your help has saved me hundreds of hours of internet surfing.
fblack61