| Author |
problem with multiple character checking
|
vicneswaran boi
Greenhorn
Joined: Sep 06, 2004
Posts: 13
|
|
if( (!mHp1.equals(""))&((mHp1.length() !=8)||(mHp1.charAt(0) !='9'+!='8'))) { errorMsg += "<LI>Please check the handphone."; )||(mHp1.charAt(0) !='9'+!='8'))) { here how we can check the initial charectors 9 or 8. we need to identify the charectors using the charAt(0), is the above way to do this??? it is working for one digit example for 9 we can just check for 9,,but how to do it for multiple numbers??? Thanks for the help Vic
|
 |
Paul Sturrock
Bartender
Joined: Apr 14, 2004
Posts: 10336
|
|
|
Consider regular expressions - have a look at the java.util.regex package.
|
JavaRanch FAQ HowToAskQuestionsOnJavaRanch
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56192
|
|
|
Moving to Java in General (beginner)
|
[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
|
 |
Joel McNary
Bartender
Joined: Aug 20, 2001
Posts: 1815
|
|
Tty:
|
Piscis Babelis est parvus, flavus, et hiridicus, et est probabiliter insolitissima raritas in toto mundo.
|
 |
 |
|
|
subject: problem with multiple character checking
|
|
|