M
Marc Scheuner [MVP ADSI]
Folks,
I need to try and make sure that a given string is a valid numerical
value (not just int, or int32 - it could be float, decimal, what have
you). VB.NET has a neat "IsNumeric" function - too bad C# doesn't have
anything similar. Or does it??
I was thinking about trying to convert the string to Int32, but as I
mentioned - that alone won't be good enough, and I really don't want
to attempt a dozen conversions to find out - nor do I really want to
start parsing the string for numerical characters (since there can be
"+", "-", "." and many more extra character and it's still a valid
numeric).
Any ideas? Thoughts?
Thanks!
Marc
================================================================
Marc Scheuner May The Source Be With You!
Bern, Switzerland m.scheuner(at)inova.ch
I need to try and make sure that a given string is a valid numerical
value (not just int, or int32 - it could be float, decimal, what have
you). VB.NET has a neat "IsNumeric" function - too bad C# doesn't have
anything similar. Or does it??
I was thinking about trying to convert the string to Int32, but as I
mentioned - that alone won't be good enough, and I really don't want
to attempt a dozen conversions to find out - nor do I really want to
start parsing the string for numerical characters (since there can be
"+", "-", "." and many more extra character and it's still a valid
numeric).
Any ideas? Thoughts?
Thanks!
Marc
================================================================
Marc Scheuner May The Source Be With You!
Bern, Switzerland m.scheuner(at)inova.ch