Regular expression not working

T

tshad

I have a regular expression I am using in C that does seem to work for
dollar signs.

stemp = Regex.Replace(String.Format("{0:c}",dr["Amount"]),"$|,","");

This takes out the "," fine, but not the "$". $6,150.00 is coming back as
$6150.00.

In VB.Net, I would do:

stemp = Regex.Replace(String.Format("{0:c}",dr["Amount"]),"\$|\,","");

But that would give me an unrecognized escape sequence, in C#.

How do I do this in C#?

Thanks,

Tom
 

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