Example usage for java.lang String trim

List of usage examples for java.lang String trim

Introduction

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

Prototype

public String trim() 

Source Link

Document

Returns a string whose value is this string, with all leading and trailing space removed, where space is defined as any character whose codepoint is less than or equal to 'U+0020' (the space character).

Usage

From source file:Main.java

public static boolean isEmptyOrNullString(String s) {
    return (s == null) || (s.trim().length() == 0);
}

From source file:Main.java

public static boolean validateFileName(String str) {
    if (str.trim().length() == 0) {
        return false;
    }/*from w  w w  .ja v  a2  s  .  c om*/
    String strPattern = "[^/\\:*?\"<>|]+";
    Pattern p = Pattern.compile(strPattern);
    Matcher m = p.matcher(str);
    return m.matches();
}

From source file:Main.java

public static boolean isNullOrEmpty(String str) {
    return str == null || str.trim().equals("");
}

From source file:Main.java

public static boolean isNotBlank(String txt) {
    return txt != null && txt.trim().length() > 0 ? true : false;
}

From source file:Main.java

public static boolean isNotNull(String txt) {
    return txt != null && txt.trim().length() > 0;
}

From source file:Main.java

public static boolean isStringNullOrEmpty(String str) {
    return str == null || str.trim().length() == 0;
}

From source file:Main.java

public static boolean isPasswordMatches(String password) {
    int length = password.trim().length();
    return length >= PASSWORD_MIN_LENGTH && length <= PASSWORD_MAX_LENGTH;
}

From source file:Main.java

private static boolean isInvalid(String str) {
    return str == null || str.trim().equals("") || str.trim().length() < 5;
}

From source file:Main.java

public static synchronized boolean StrIsNull(String str) {
    return null == str || str.trim().length() <= 0 ? true : false;
}

From source file:Main.java

public static boolean isValid(String str) {
    return (str != null && str.trim().length() > 0);
}