[java] Java Program to test if a character is uppercase/lowercase/number/vowel

 Char input;

 if (input.matches("^[a-zA-Z]+$")) 
 {
     if (Character.isLowerCase(input))
     {
        // lowercase
     } 
     else
     { 
        // uppercase
     }

     if (input.matches("[^aeiouAEIOU]"))
     {
          // vowel
     }
     else 
     {
         // consonant
     }
 }
 else if (input.matches("^(0|[1-9][0-9]*)$"))
 {
       // number
 }
 else
 {
     // invalid
 }

Examples related to java

Under what circumstances can I call findViewById with an Options Menu / Action Bar item? How much should a function trust another function How to implement a simple scenario the OO way Two constructors How do I get some variable from another class in Java? this in equals method How to split a string in two and store it in a field How to do perspective fixing? String index out of range: 4 My eclipse won't open, i download the bundle pack it keeps saying error log

Examples related to uppercase

Capitalize the first letter of string in AngularJs Ignoring upper case and lower case in Java Convert from lowercase to uppercase all values in all character variables in dataframe In Android EditText, how to force writing uppercase? how to convert Lower case letters to upper case letters & and upper case letters to lower case letters How to convert a string from uppercase to lowercase in Bash? How to change a string into uppercase Java Program to test if a character is uppercase/lowercase/number/vowel How do I lowercase a string in Python? Capitalize or change case of an NSString in Objective-C

Examples related to lowercase

Ignoring upper case and lower case in Java how to convert Lower case letters to upper case letters & and upper case letters to lower case letters How to detect lowercase letters in Python? .toLowerCase not working, replacement function? How to convert a string from uppercase to lowercase in Bash? How to convert array values to lowercase in PHP? Java Program to test if a character is uppercase/lowercase/number/vowel How do I lowercase a string in Python? How do I lowercase a string in C? How to convert a string to lower case in Bash?