Hi all:
I am stuck with a simple problem here. I have a file where there are 2 data types String(Item_Name) and int(Item_Code). Something like this:
----------------------------------------------------
Item_Code | Item_Name |
----------------------------------------------------
34 Pens
7 Ice Cream
----------------------------------------------------
Now, I can catch the error if users input character in Item_code like '34ab' with NumberFormatException but how to catch if they put digits in Item_Name like 'Pen345s' ?
Should I first use string tokenizer to divide the strings and then check by individual characters? How to know if its a digit?
thanks in advance.