in C# , how can i check whether the value stored inside a string object( Ex : string strOrderId=\"435242A\") is decimal or not?
In case if we do not want use extra variable.
string strOrderId = "435242A"; bool isDecimal = isDecimal(strOrderId); public bool isDecimal(string value) { try { Decimal.Parse(value); return true; } catch { return false; } }