public static boolean isBoolean ( String number ) { boolean result = false ; if ( number != null && ( number . equalsIgnoreCase ( "true" ) || number . equalsIgnoreCase ( "false" ) ) ) { result = true ; } return result ; }
Checks if a string is a valid boolean