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 isPasswordTypeCorrect(String password) {
    if (password.length() < 8)
        return false;
    return true;//  ww  w .  j  a  v  a 2 s  . c o m

}

From source file:Main.java

public static String dataSubstring(String _string) {
    if (_string.length() > 31) {
        return _string.substring(0, 28) + " ...";
    } else//from  w ww  .  ja  v a  2 s . c  o m
        return _string;

}

From source file:Main.java

public static byte[] codeString(String str) {
    int L = str.length();
    byte[] result;
    if (L < 254) {
    }// w  ww  .j a va2s  .c  o m
    return null;
}

From source file:Main.java

public static boolean isPasswordTypeCorrect(String password) {
    if (password.length() < 6 || password.length() > 12)
        return false;
    return true;//from   w w w . ja  va 2 s  . c om

}

From source file:ReverseStringTest.java

public static String reverseIt(String source) {
    int i, len = source.length();
    StringBuffer dest = new StringBuffer(len);

    for (i = (len - 1); i >= 0; i--)
        dest.append(source.charAt(i));/*from   w w  w  .java 2 s .  c o m*/
    return dest.toString();
}

From source file:Main.java

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

From source file:Main.java

public static String removeChar(String s, char c) {
    String r = "";
    for (int i = 0; i < s.length(); i++) {
        if (s.charAt(i) != c)
            r += s.charAt(i);/*from w w w.ja v  a  2s  .c  o m*/
    }
    return r;

}

From source file:Main.java

public static String capitalize(final String word) {
    if (word.length() > 1) {
        return String.valueOf(word.charAt(0)).toUpperCase() + word.substring(1);
    }//w w w . ja v  a2 s  . c  o  m
    return word;
}

From source file:Main.java

public static boolean isValidPassword(String password) {
    if (password.length() < 9) {
        return false;
    } else {//from ww w .j av  a  2 s.co  m
        return true;
    }
}

From source file:Main.java

public static boolean isValidContact(String mobileNumber) {
    return !(mobileNumber.length() < 7 || mobileNumber.length() > 12);
}