c# - using numbers in a string -


Can I use numbers using the string data type?

Make sure you can, and if you want to use them as numbers You can parse the string such as for an integer:

  string numbereststring = "42"; Int numberFromString; If (int.TryParse (numberAsString, out numberFromString)) {// number successfully parsed with string}  

Bull will return to parsing if successful. You can also parse directly even if you know that there is a number in the string - using. The string can not be parsed, if it will be thrown.

  integer number = int.Parse ("42");  

Comments

Popular posts from this blog

oracle - The fastest way to check if some records in a database table? -

php - multilevel menu with multilevel array -

jQuery UI: Datepicker month format -