List of usage examples for java.lang CharSequence length
int length();
From source file:Main.java
private static int getStartIndex(CharSequence input) { int length = input.length(); int index = 0; while (Character.isWhitespace(input.charAt(index))) { ++index;/* w ww. j a v a 2s .co m*/ if (index >= length) { break; } } return index; }
From source file:Main.java
public static boolean isEmpty(CharSequence sequence) { return sequence == null || sequence.length() == 0; }
From source file:Main.java
public static boolean isEmpty(CharSequence sequence) { return null == sequence || sequence.length() <= 0; }
From source file:Main.java
public static int length(CharSequence s) { return s == null ? 0 : s.length(); }
From source file:Main.java
public static boolean lastCharIsOperator(CharSequence text) { char last_char = text.charAt(text.length() - 1); return (last_char == '-' || last_char == '*' || last_char == '/' || last_char == '+'); }
From source file:Main.java
public static boolean isAlphaNumeric(CharSequence input) { if (input == null || input.length() == 0) { return false; }//from w w w. j av a 2 s . c om return Pattern.compile("[a-zA-Z0-9 \\./-]*").matcher(input).matches(); }
From source file:Main.java
public static boolean isEmpty(final CharSequence str) { if (str == null || str.length() == 0) { return true; } else {/*from w w w. j a v a 2s .c o m*/ return false; } }
From source file:Main.java
static boolean isNullOrEmpty(CharSequence message) { return message == null || message.length() == 0; }
From source file:Main.java
public static boolean isEmailAddress(CharSequence input) { if (input == null || input.length() == 0) { return false; }//from ww w . j a v a 2 s .c o m return Pattern.compile("[a-zA-Z0-9\\+\\.\\_\\%\\-\\+]{1,256}" + "\\@" + "[a-zA-Z0-9][a-zA-Z0-9\\-]{0,64}" + "(" + "\\." + "[a-zA-Z0-9][a-zA-Z0-9\\-]{0,25}" + ")+").matcher(input).matches(); }
From source file:Main.java
public static boolean isPasswordValid(CharSequence password) { if (password != null && password.length() >= 6) { return true; }// w w w.j a va 2 s .c om return false; }