   [C#]How to check the amount of numbers in an int var?
  I'm doing a code to check how much I remember from C#, but I got to a problem.1.When I change a string var to an int var, how can I be sure that the string only contains numbers, and not letters? (Talking about Console.ReadLine).2.How can I check the amount of numbers there are in the int var?3.What's the difference between Console.Read and Console.ReadLine?Thanks in advance.   
  1) int.Parse(string) will throw an exception if the string contains letters so just catch the exception and ask the user for another input.2) I assume you are after the length of the integer try...  int myInt = int.Parse("12345");int intLength = myInt.ToString().Length;//May not be the most effeciant, but easy3) I don't use the console much but from memory Read returns an int representing the key pressed and ReadLine returns a string of all characters entered when "enter" is pressed.   ;  Alternatively you can use: bool int.TryParse(string, out int)The returned bool indicates whether the parse succeeded, and if so, the result of the parse will be placed in the out int.   