Determine if a String is an Integer in Java [duplicate]

I’m trying to determine if a particular item in an Array of strings is an integer or not.

I am .split(" ")‘ing an infix expression in String form, and then trying to split the resultant array into two arrays; one for integers, one for operators, whilst discarding parentheses, and other miscellaneous items. What would be the best way to accomplish this?

I thought I might be able to find a Integer.isInteger(String arg) method or something, but no such luck.

9 Answers
9

Leave a Comment