StrToNullInt string

.StrToNullInt()

Takes a string containing an int and converts it to an int? type.

Method

public static int? StrToNullInt(this string value)
string value

The string to convert to an int?.

Example

C#
bool? x = "5".StrToNullInt();
C#
bool? x = "".StrToNullInt();