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

objective c - iPhone and it's wireless area -

unix - Listing all shared memory segments used by a process on AIX5.3+ -

.net - Self Tracking Entities (STE)'s and partial updates with EF4 and mVC2 -