Remove double quotes

  • Thread starter Thread starter Asif
  • Start date Start date
A

Asif

Hi all,

I am trying to remove the following characters in string.

1- Double quotes (")
2- Black slashes ("\")

Can anyone help me out how to remove them from string?

Thanks in advance

Asif
 
yourstring = System.Text.RegularExpressions.Regex.Replace(yourstring,
@"""|\\","");

If this is for SQL, use a parameter instead :)
 
Tim said:
yourstring = System.Text.RegularExpressions.Regex.Replace(yourstring,
@"""|\\","");

I would expect 2 ordinary Replace to be faster
than a Regex Replace.
If this is for SQL, use a parameter instead :)

Very good point !

Arne
 

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