I am new to c# and I am using windows forms.
I want to subtract a value from label1.Text
but I have problem with £
symbol
Let's say label1.Text
has value with £
symbol like this: label1.Text = £10.5
Now I want to subtract a value from label1.Text
but the issue that the £ is there. Let's say I want to subtract value of 5 from label1.Text
as following:
double V = 5;
// now trim the £ sign from label1.Text
string s= Convert.ToString(label1.Text).Replace("£","");
// now s = 10.5
double result = Convert.ToDouble(s); // it throws error here on this line
double Sum = result -v;
when I run the program it throws an error "Input string was not in correct format"
Anyone knows what I am doing wrong? Please help me how can I subtract a value from a string which contains £ symbol in correct way. Thank you