wood burning stoves 2.0*
The moose likes Beginning Java and the fly likes problem  with multiple character checking Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "problem  with multiple character checking" Watch "problem  with multiple character checking" New topic
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: 61095
    
  66

Moving to Java in General (beginner)


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Joel McNary
Bartender

Joined: Aug 20, 2001
Posts: 1817

Tty:


Piscis Babelis est parvus, flavus, et hiridicus, et est probabiliter insolitissima raritas in toto mundo.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: problem with multiple character checking