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 String formatStr(String str) {
    return str.trim();
}

From source file:Main.java

public static boolean isNickMatches(String nick) {
    nick = nick.trim();
    return nick.length() > 0 && nick.length() <= NICK_MAX_LENGTH;
}

From source file:Main.java

public static String fromEscapedString(String escapedIp) {
    return escapedIp.trim().replaceAll("_", "\\.");
}

From source file:Main.java

public static long getHanziCount(String pin1yin1) {
    return pin1yin1.trim().split("-").length;
}

From source file:Main.java

public static long getWordCount(String sent) {
    return (long) sent.trim().split("\\W+").length;
}

From source file:Main.java

public static final String allowSpaceInsteadOfHyphen(String queryString) {
    return queryString.trim().replaceAll(" +", " ").replaceAll(" ", "-");
}

From source file:Main.java

public static boolean isCampoEmBranco(String fieldName) {

    return fieldName.trim().equals("");
}

From source file:Main.java

public static boolean isRCIDMatches(String rcId) {
    rcId = rcId.trim();
    int textLength = rcId.length();
    return rcId.matches(RCID_REGEX) && textLength >= RCID_MIN_LENGTH && textLength <= RCID_MAX_LENGTH;
}

From source file:Main.java

private static String removeRightBracket(String value) {
    String str = value.trim();
    return value.substring(0, str.length() - 1);
}

From source file:Main.java

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