Robert
Robert

Reputation: 83

How to use escape character in replace function when replacing semi-colon in VB

Okay so I was helped earlier with my program question and found out that """" is how you make " become another variable in the function:

Robert = Replace(Robert.ToLower, """", "A")

So now I am also trying to work with other keys like the semi-colon. I put it in the function like this:

Robert = Replace(Robert.ToLower, "char(59)", "B")

I also tried to insert ; in place of char(59) with \ in front of it as an escape key, none of this worked. It still just gives me a ; when I type a ;. Can someone please help me with this? Thanks!

Upvotes: 0

Views: 1153

Answers (2)

Thorarin
Thorarin

Reputation: 48486

Robert = Replace(Robert.ToLower, chr(59), "B")

Upvotes: 1

Mitch Wheat
Mitch Wheat

Reputation: 300599

Robert = Replace(Robert.ToLower, chr$(59), "B")

Upvotes: 0

Related Questions