C# 字符串、int、double互转

string str = "100"; 
double num = 10; 
int count = 5;

string temp = string.Empty;
//int、double转string
temp = count.ToString(); 
temp = num.ToString(); 

int index;
double num2;
//string转int、double
num2 = System.Convert.ToDouble(string); 
index = System.Convert.ToInt(string); 

 

你可能感兴趣的:(C#)