Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / February 2005

Tip: Looking for answers? Try searching our database.

Search and Replace in String

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Eternally grateful - 01 Feb 2005 03:37 GMT
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.
Vince - 01 Feb 2005 04:53 GMT
myData=Replace(myData,chr(40),"-")

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

Is this what you want?

Vince

> Can anyone tell me if it is possible to perform a search and replace inside
> of a string?
[quoted text clipped - 5 lines]
>
> Thank you for taking them time to read this.
Vince - 01 Feb 2005 06:03 GMT
Sorry, I meant emdash (the symbol) there. Not 3/4. Using the ASCII should
work
> myData=Replace(myData,chr(40),"-")
>
[quoted text clipped - 16 lines]
> >
> > Thank you for taking them time to read this.
Jezebel - 01 Feb 2005 06:05 GMT
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), "-")

> myData=Replace(myData,chr(40),"-")
>
[quoted text clipped - 16 lines]
>>
>> Thank you for taking them time to read this.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.