Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

java code to check if string is alphanumeric

java.util.regex.*;
class AlphanumericExample
{
  public static void main(String...s)
  {
    String s1="adA12", s2="jh@l";
    System.out.println(s1.matches("[a-zA-Z0-9]+"));
    System.out.println(s2.matches("[a-zA-Z0-9]+"));
  }
}
 
PREVIOUS NEXT
Tagged: #java #code #check #string #alphanumeric
ADD COMMENT
Topic
Name
2+2 =