Replace, but ignore certain characters


C

Christopher M.

I'd like to ignore certain characters when I use the replace function.

For instance if I want to replace the phrase:

'said I'

in the phrase:

'Jim said (I farted)'.

In order to do this it seems that I have to ignore the parentheses in 'said
(I'.


W. Pooh (AKA Winnie P.)
 
Ad

Advertisements

S

Stuart McCall

Christopher M. said:
I'd like to ignore certain characters when I use the replace function.

For instance if I want to replace the phrase:

'said I'

in the phrase:

'Jim said (I farted)'.

In order to do this it seems that I have to ignore the parentheses in
'said (I'.


W. Pooh (AKA Winnie P.)

Try putting the string into a temp variable, replacing the parens with "",
then do the replace on that.
 
C

Christopher M.

Stuart McCall said:
Try putting the string into a temp variable, replacing the parens with "",
then do the replace on that.

What I really want to do is ignore formatting, when I do a replace.


W. Pooh (AKA Winnie P.)
 
S

Stuart McCall

Christopher M. said:
What I really want to do is ignore formatting, when I do a replace.

Well presumably you know where the parens should appear in your replacement
string, so once you've stripped them out and done your replace, put them
back in.
 
Ad

Advertisements

C

Christopher M.

Stuart McCall said:
Well presumably you know where the parens should appear in your
replacement string, so once you've stripped them out and done your
replace, put them back in.

That should do the trick. Thanks.


W. Pooh (AKA Winnie P.)
 

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