Easy question, I know. But failing nonethless!
In C sharp you can simply type:
string mystring = "4";
int myint = convert.toint32(mystring);
I am getting a Null Unhandled Exception leading me to suspect this does not work using MonoDroid. So I dug into the API and found the Cast class which supposedly lets you covert between int and string class types.
[Android.Runtime.Register("cast", "(Ljava/lang/Object;)Ljava/lang/Object;", "")]
public Object Cast (Object obj)
However none of my attempts to utilize the class have worked. The below fails:
int myint= Class.Cast(mystring);
That’s not true – since you are using MonoDroid of course the same code works just fine: