• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

problem with multiple character checking

 
vicneswaran boi
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Consider regular expressions - have a look at the java.util.regex package.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64994
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moving to Java in General (beginner)
 
Joel McNary
Bartender
Posts: 1840
Eclipse IDE Java Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tty:
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic