viernes, 7 de noviembre de 2014

C# - How to convert int to string




Hi!
C# allows the conversion of numbers to text by making use of a simple internal function: ToString()

Steps to get the conversion:

1.- Create a String variable and initialize it as empty

2.- Create an Integer variable (int) and initialize it with a value

3.- Assign the result of conversion to the String variable


Example:


String val = "";
int number = 24;
val = number.ToString();
This value can now be added to a texbox, show it in a MessageBox, etc.


If this post was useful for you, please share it. Thanks!

No hay comentarios.:

Publicar un comentario