TryParse Method in C# - Converting string into int if possible

Описание к видео TryParse Method in C# - Converting string into int if possible

Converts the string representation of a number to its 32-bit signed integer equivalent. A return value indicates whether the operation succeeded.
public static bool TryParse (string s, out int result);
Parameters:
String
result:
Int32
When this method returns, contains the 32-bit signed integer value equivalent of the number contained in s, if the conversion succeeded, or zero if the conversion failed. The conversion fails if the s parameter is null or Empty, is not of the correct format, or represents a number less than MinValue or greater than MaxValue. This parameter is passed uninitialized; any value originally supplied in result will be overwritten.
Return:
boolean
true if s was converted successfully; otherwise, false.

Комментарии

Информация по комментариям в разработке