Results 1 to 2 of 2
  1. #1
    Roselicious is offline Member
    Join Date
    Apr 2010
    Posts
    24
    Rep Power
    0

    Default How to validate NRIC number

    For example , assuming that NRIC number starts with 'S' and has 7 digits after 'S' :(

  2. #2
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    25

    Default

    You could either loop through the String with a for loop checking each char via charAt(..) checking to see if it's S or s and then if digits via a Character method, or you could use a regular expression.

Similar Threads

  1. Using NRIC.no to calculate and retrieve last alphabet
    By Roselicious in forum New To Java
    Replies: 3
    Last Post: 04-15-2010, 06:33 PM
  2. Finding a number in array close to another number
    By SteroidalPsycho in forum New To Java
    Replies: 2
    Last Post: 02-15-2010, 12:37 AM
  3. Printing the Number of Times a Number in a Range Shows up
    By space4rent00 in forum New To Java
    Replies: 1
    Last Post: 02-05-2010, 10:42 PM
  4. unable to validate
    By sanser in forum Java Servlet
    Replies: 4
    Last Post: 10-28-2009, 09:41 AM
  5. Replies: 0
    Last Post: 03-01-2008, 10:01 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •