1.int转string

int a = 2; 
string b = a.ToString();string s2 = Convert.ToString(a);

 

2.string转int

string s = "18";
int a1 = int.Parse(s);
int a2;
int.TryParse(s, out a2);
int a3 = Convert.ToInt32(s);

黄世宇/Shiyu Huang's Personal Page:​​https://huangshiyu13.github.io/​