Quantcast
Channel: If else statement with a substring - Stack Overflow
Browsing index pages (2 articles)

If else statement with a substring

I'm attempting to make an if else statement in which the middle value looks to see if the 4th digit in the sub string is an integer if it is I want a negative in front of the number if its not i want...

View Article


Answer by Sergey Kalinichenko for If else statement with a substring

The way you check a single character to be digit is not with Integer.parseInt (that one returns, an int, not a boolean). You use Character.isDigit instead:else if (strPos.length() > 4 &&...

View Article

Browsing index pages (2 articles)


Latest Images