Re: validate that string input is a negative number
- From: Jon Skeet [C# MVP] <skeet@xxxxxxxxx>
- Date: Wed, 28 Mar 2007 19:37:42 +0100
mpetrotta@xxxxxxxxx <mpetrotta@xxxxxxxxx> wrote:
<snip>
Or just a nice simple
int val;
return Int32.TryParse(s, out val) && val < 0
Exactly. This thread is a good example of why it's wise to avoid using
regular expressions where they're not truly advantageous :)
--
Jon Skeet - <skeet@xxxxxxxxx>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
.
- References:
- Re: validate that string input is a negative number
- From: Alberto Poblacion
- Re: validate that string input is a negative number
- From: Larry Lard
- Re: validate that string input is a negative number
- From: Alberto Poblacion
- Re: validate that string input is a negative number
- From: Mythran
- Re: validate that string input is a negative number
- From: mpetrotta@xxxxxxxxx
- Re: validate that string input is a negative number
- Prev by Date: Re: get names of parameters
- Next by Date: How do I create partial class to be nested under the main class file?
- Previous by thread: Re: validate that string input is a negative number
- Next by thread: Re: Working of static constructor in case of Generic Types
- Index(es):
Relevant Pages
|