Example usage for java.lang String length

List of usage examples for java.lang String length

Introduction

In this page you can find the example usage for java.lang String length.

Prototype

public int length() 

Source Link

Document

Returns the length of this string.

Usage

From source file:Main.java

public static boolean isSMSStrLentht(String text) {
    return text.length() <= 70;
}

From source file:Main.java

public static boolean isValidNumber(String name) {
    return name.length() > 6 && name.length() < 20;
}

From source file:Main.java

public static boolean isPlateValid(String plate) {
    return plate.length() > 3;
}

From source file:example.ToCommonsEmpty.java

public static void main2(String[] args) {
    String s = "";

    boolean a = s == null || s.length() == 0;
    boolean b = s == null || s.isEmpty();
    boolean c = s != null && s.isEmpty();
    boolean d = s != null && s.length() == 0;
}

From source file:Main.java

public static String getIndexString(String str) {
    if (str.length() <= 5) {
        return str;
    }//from www  .ja  v  a  2 s  .c  o  m
    return str.substring(5);
}

From source file:Main.java

public static boolean checkPassword3(String pwd) {
    return !(pwd.length() < 6 || pwd.length() > 20);
}

From source file:Main.java

public static Boolean checkPwd(String pwd) {
    if (pwd.length() != 6) {
        return false;
    }/*from   w  w  w. j  a v  a 2 s . c o m*/
    return true;
}

From source file:Main.java

public static Boolean checkPwds(String pwd) {
    if (pwd.length() < 6 || pwd.length() > 10) {
        return false;
    }/*from w  w  w. j  a  v  a  2 s.  c om*/
    return true;
}

From source file:Main.java

public static String capitalize(String pValue) {
    if (pValue.length() <= 1)
        return pValue;
    return pValue.substring(0, 1).toUpperCase() + pValue.substring(1);
}

From source file:Main.java

public static boolean isPasswordValid(String password) {
    return password.length() > 4;
}