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
Post a Comment