Click here to Skip to main content
15,891,473 members
Articles / Programming Languages / C#

Basic string to integer conversion extensions

Rate me:
Please Sign up or sign in to vote.
5.00/5 (2 votes)
15 Jun 2011CPOL 9.2K  
As it stands, the TryParse method will fail if the string contains commas. E.g., 10,000. To get around this, you can use:bool isnumber=int.TryParse(text,System.Globalization.NumberStyles.Integer | System.Globalization.NumberStyles.AllowThousands, ...

Views

Daily Counts

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Student
Wales Wales
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions