Описание тега tryparse
Converts the string representation of an object to its typed equivalent. A return value indicates whether the operation succeeded.
Converts the string representation of an object to its typed equivalent. A return value indicates whether the operation succeeded.
The TryParse method is like the Parse method, except the TryParse method does not throw an exception if the conversion fails. It eliminates the need to use exception handling to test for a FormatException in the event that the string is invalid and cannot be successfully parsed.