Converting



String to Integer


int i; 
i = (int)myString;
i = (System.Int32)myString;
i = myString as int;
i = myString as System.Int32;
i = System.Convert.ToInt32(myString);
i = System.Int32.Parse(myString);

Integer to String


int i = 10; 
string s;
s = i.ToString();
s = System.Convert.ToString(i);
s = System.String.Format("{0}",i);
s = $"{i}";
s = "" + i;
s = System.String.Empty + i;
s = new System.Text.StringBuilder().Append(i).ToString();



© 2024 Better Solutions Limited. All Rights Reserved. © 2024 Better Solutions Limited TopPrevNext