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

Popular posts from this blog

Azure DocumentDB Owner resource does not exist

BizTalk Server 2013 Azure VM Log Shipping and HA for hosts

How to Share webservice object to all user