I have a string read from a textbox. It contains a comma for decimal separation.
I have NumberFormatInfo.CurrencyDecimalSeparator set to ,
NumberFormatInfo.CurrencyDecimalSeparator
,
Instead of replace we can force culture like
var x = decimal.Parse("18,285", new NumberFormatInfo() { NumberDecimalSeparator = "," });
it will give output 18.285