G
Guadala Harry
What are the options for testing to see if a String variable contains a
value that can be converted to an integer (vs containing a value that cannot
be converted to an integer)?
e.g., "784" can be converted to an integer
whereas "nope" cannot be converted to an integer
nor can "" (a zero length string) be converted to an integer
nor can null (the 'null' value) be converted to an integer
Please note that I do not want rely on error handling for this - if the
input value cannot be converted, I need to simply skip the particular input
and proceed to processing others. AFAIK, if I rely on error handling, then
processing would have to stop - or I'd have to get into some ugly recursive
call situation - or I'd have to nest a bunch of try... catch blocks. So,
without doing this test via error handling, what are my options?
Thanks!
value that can be converted to an integer (vs containing a value that cannot
be converted to an integer)?
e.g., "784" can be converted to an integer
whereas "nope" cannot be converted to an integer
nor can "" (a zero length string) be converted to an integer
nor can null (the 'null' value) be converted to an integer
Please note that I do not want rely on error handling for this - if the
input value cannot be converted, I need to simply skip the particular input
and proceed to processing others. AFAIK, if I rely on error handling, then
processing would have to stop - or I'd have to get into some ugly recursive
call situation - or I'd have to nest a bunch of try... catch blocks. So,
without doing this test via error handling, what are my options?
Thanks!