I am creating a program that looks at the string and then outputs whether or not it is a Word, a number, Something else, or a empty string. I am new to programming and the problem i come accross is that i know of the Character.isLetter, Character.isDigit methods but i cannot use them because i am using a String and not Characters. This may be a really easy question, but i would appreciate it if someone could shed some light on my situation.
Have a look at Regular Expressions. A word would match the regular expression
[A-Z-a-z]+, a possibly negative integer number would match the regular expression
-?[0-9]+. There are many variations to this theme, i.e. you can come up with
other regular expressions that match the same. Read the API documentation for
the Pattern and Matcher classes.
kind regards,
Jos