P
Paul K
I'm writing a small component that needs to be as fast as
possible. The component needs to convert a string to
decimal during the course of it's processing. However, I
need to test the string first to make sure it is
numeric. Using the is keyword doesn't work (strings
cannot be cast as decimal so false is always returned)
and catching an exception from Convert.ToDecimal or
decimal.Parse is too slow.
Does anyone know of any methods of testing strings to see
if they are numerical without converting the string?
Paul K
possible. The component needs to convert a string to
decimal during the course of it's processing. However, I
need to test the string first to make sure it is
numeric. Using the is keyword doesn't work (strings
cannot be cast as decimal so false is always returned)
and catching an exception from Convert.ToDecimal or
decimal.Parse is too slow.
Does anyone know of any methods of testing strings to see
if they are numerical without converting the string?
Paul K