Search and Replace in String

  • Thread starter Eternally grateful
  • Start date
E

Eternally grateful

Can anyone tell me if it is possible to perform a search and replace inside
of a string?

I have a string called myData that contains an emdash that I need to change
into a hyphen and I cannot find a way to do this.

Any assistance would be greatly appreciated.

Thank you for taking them time to read this.
 
V

Vince

myData=Replace(myData,chr(40),"-")

OR
myData=Replace(myData,"¾","-")

Is this what you want?

Vince
 
J

Jezebel

em-dash is chr(150)

BTW, the string versions of these functions are about 10 times faster than
the variant equivalents --

MyData = Replace$(OldData, chr$(150), "-")
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top