C# Query from Google

One of the queries that someone entered in to Google and found my site was:c# test a string to see if it is a number:I suppose there are a couple of ways that this can be done.If you know the datatype that you want to convert it to [i.e you know the numeric range] you can use the Convert class.Convert.ToInt16 (short), Convert.ToInt32 (int), Convert.ToFloat (floats). etc etcYou could also use a regex along the lines of:/^[0-9]+$/or/^[\d]+$/both of the above regex’s will check to see if it is a numeric string.


This content originally appeared on Modern Web Development with Chrome and was authored by Paul Kinlan

<p>One of the queries that someone entered in to Google and found my site was:<strong>c# test a string to see if it is a number</strong>:I suppose there are a couple of ways that this can be done.<p />If you know the datatype that you want to convert it to [i.e you know the numeric range] you can use the Convert class.<strong>Convert.ToInt16 (short), Convert.ToInt32 (int), Convert.ToFloat (floats). etc etc</strong><p />You could also use a regex along the lines of:<p />/^[0-9]+$/or/^[\d]+$/<p />both of the above regex's will check to see if it is a numeric string. (Whole numbers only though).<p />Anyone who is looking for <strong>c# test a string to see if it is a number</strong>; I hope you find this usefull.<p /></p>


This content originally appeared on Modern Web Development with Chrome and was authored by Paul Kinlan


Print Share Comment Cite Upload Translate Updates
APA

Paul Kinlan | Sciencx (2005-11-05T00:00:00+00:00) C# Query from Google. Retrieved from https://www.scien.cx/2005/11/05/c-query-from-google/

MLA
" » C# Query from Google." Paul Kinlan | Sciencx - Saturday November 5, 2005, https://www.scien.cx/2005/11/05/c-query-from-google/
HARVARD
Paul Kinlan | Sciencx Saturday November 5, 2005 » C# Query from Google., viewed ,<https://www.scien.cx/2005/11/05/c-query-from-google/>
VANCOUVER
Paul Kinlan | Sciencx - » C# Query from Google. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2005/11/05/c-query-from-google/
CHICAGO
" » C# Query from Google." Paul Kinlan | Sciencx - Accessed . https://www.scien.cx/2005/11/05/c-query-from-google/
IEEE
" » C# Query from Google." Paul Kinlan | Sciencx [Online]. Available: https://www.scien.cx/2005/11/05/c-query-from-google/. [Accessed: ]
rf:citation
» C# Query from Google | Paul Kinlan | Sciencx | https://www.scien.cx/2005/11/05/c-query-from-google/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.