Nullable Int32 Parse
is possible parse string nullable integer? if string can parsed parse method return integer, if not return null.
here how expect work:
string s = "5";
int32? i;
i = {something}.parse(s);
i have seen question asked many times, not find answer guessing cannot done in v2.
you can write own {something}, need contain method:
public static int? parse(string s) { int i; if (int.tryparse(s, out i)) return i; else return null; } |
Archived Forums V > Visual C# Language
Comments
Post a Comment