Sponsored Link •
|
Advertisement
|
Advertisement
|
This page contains an archived post to the Java Answers Forum made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.
Message:
Try putting the value from your substring into a number like this: int parsedNumber = Integer.paresInt(num.substring(0,2)); use logical and '&&' or logical or '||' in your if statment to match on more than one condition. Like this: if(parsedNumber == 12 || parsedNumber == 25 || parsedNumber == 35){ hope this helps. > I need to see if the first two digits are 12,25,35 etc. depending on these numbers I need to assign values to variable. How can I achieve this. I have the following code it works fine with one: > ================================== > Thanks in advance :)
Replies: |
Sponsored Links
|