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

private static boolean isEmpty(String json) {
    return json == null || json.trim().length() == 0;
}

From source file:Main.java

public static boolean isBlankString(String str) {
    if (str == null || str.trim().length() == 0 || str.equals("") || str.equals("null")) {
        return true;
    } else {/* w  ww . java2 s.c om*/
        return false;
    }
}

From source file:Main.java

static private String processArgumentName(String name) {
    return (name == null || name.trim().isEmpty()) ? DEFAULT_NAME : name;
}

From source file:Main.java

public static String trim(String st) {
    return (st == null) ? "" : st.trim();
}

From source file:Main.java

private static boolean isNullOrEmpty(String str) {
    if (str == null || str.trim().equals("")) {
        return true;
    } else {/*from ww  w. j  a va 2s.c o  m*/
        return false;
    }
}

From source file:Main.java

public static boolean notEmpty(String obj) {
    if (obj != null && obj.trim().length() > 0) {
        return true;
    } else {/*from  w  w w  .ja va  2 s .c  o m*/
        return false;
    }
}

From source file:Main.java

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

From source file:Main.java

public static boolean stringIsNull(String value) {
    return value == null || value.trim().length() <= 0;
}

From source file:Main.java

public static boolean isVaildUrl(String url) {
    if (url == null || url.trim().equals("")) {
        return false;
    }/*ww w  .  j a v  a2  s .c  o  m*/
    return URLUtil.isValidUrl(url.trim());
}

From source file:Main.java

public static boolean isUrl(String str) {
    if (str == null || str.trim().length() == 0)
        return false;
    return URL.matcher(str).matches();
}