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.

<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>


Print Share Comment Cite Upload Translate
APA
Paul Kinlan | Sciencx (2024-03-28T20:52:03+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 2024-03-28T20:52:03+00:00,<https://www.scien.cx/2005/11/05/c-query-from-google/>
VANCOUVER
Paul Kinlan | Sciencx - » C# Query from Google. [Internet]. [Accessed 2024-03-28T20:52:03+00:00]. Available from: https://www.scien.cx/2005/11/05/c-query-from-google/
CHICAGO
" » C# Query from Google." Paul Kinlan | Sciencx - Accessed 2024-03-28T20:52:03+00:00. 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: 2024-03-28T20:52:03+00:00]
rf:citation
» C# Query from Google | Paul Kinlan | Sciencx | https://www.scien.cx/2005/11/05/c-query-from-google/ | 2024-03-28T20:52:03+00:00
https://github.com/addpipe/simple-recorderjs-demo