Do you need to cast string or int? For string use System.string and for int use System.Int32 to declare variable in x++.
For example
str xStr = "test";
System.String cStr;
cStr = xStr;
int i = 1;
System.Int32 cInt = i;
Not sure if you are looking something else.