I\'m coding a peace of code that extracts some data from a DB. And the problem is that I want to convert a negative number string \"−2.8\" to a double. Pretty easy, I though
You have a character that is not the minus character used in numbers (you have hyphen, not dash). You have to replace it, there's no other "elegant" way. Those two characters only visually resemble each other but they are not meant to replace each other without a change of meaning.
var climateString = "−2.8";
var number = double.Parse(climateString.Replace("−","-"));