Quantcast
Channel: ASP.NET AJAX + Ajax Control Toolkit (ACT)
Viewing all articles
Browse latest Browse all 5678

What is the easiest way to remove a character from a string with c#?

$
0
0

I am using the following to replace characters, and it works great unless I want to actually remove it.

string strValue = "$3,000.00";

strValue = strValue.Replace('$', ' '); // This works when i replace it with a space.

strValue = strValue.Replace('$', '');  / Doesn't work when trying to replace it with nothing.

.Remove works to replace a character at a specific index, but I don't see a way to use it to remove a specific character.


Viewing all articles
Browse latest Browse all 5678

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>