De-Format Currency in C#
- by hpatel298
I have a string value coming from a label in the .aspx page as following.
string text = Price.Text; // Price.Text = "$31.07"
Single value = Convert.ToSingle(text); //throws FormatException
I can replace the $ sign with the empty text and then Convert to Single but I was wondering if there is better way to de-format the text with the '$' sign into a Single.