Q: remove a certain string in string

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello,
I have a string and I want to remove only certain string, if exits. Here is
an example: “ABC,FCG,XXX,FFAâ€, I need to remove XXX and keep the rest in the
string, how can I do that?
Thanks,
Jim.
 
str.Replace("XXX","")
or more safe
str.Replace(",XXX,",",,")


HTH,

Elton Wang
 
And if you need a little more flexibility, you could try Regex.Replace()
 

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

Back
Top