Horje
java code to check if string is alphanumeric Code Example
check if a string is alphanumeric
 if (string.match(/^[0-9A-Za-z]+$/) === null) { 
 //is not alphanumeric
 }else{
 //it is alphanumeric
 }
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]+"));
  }
}
check character is alphanumeric java
 javaCopypublic class CheckCharAlpha {
    public static void main(String[] args) {

        boolean letterOrDigit = isAlphaNumeric('k');
        System.out.println(letterOrDigit);
    }

    public static boolean isAlphaNumeric(char char1) {
        return (char1 >= 'a' && char1 <= 'z') || (char1 >= 'A' && char1 <= 'Z') || (char1 >= '0' && char1 <= '9');
    }
}




Java

Related
android application manifest Code Example android application manifest Code Example
java kommentointi Code Example java kommentointi Code Example
android action key Code Example android action key Code Example
java instance of a class Code Example java instance of a class Code Example
can we create an object of interface in java Code Example can we create an object of interface in java Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
8