decimal decimalVal; Decimal.TryParse(\"123-\", out decimalVal); Console.WriteLine(decimalVal); // -123
Why do \"123-\" string parsed this way?
This is an accepted format for Decimal.Parse. The style option to the Parse method allows for leading and trailing signs.
Decimal.Parse
style
Parse
Read more: http://msdn.microsoft.com/en-us/library/91fwbcsb.aspx