Example usage for java.lang String contains

List of usage examples for java.lang String contains

Introduction

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

Prototype

public boolean contains(CharSequence s) 

Source Link

Document

Returns true if and only if this string contains the specified sequence of char values.

Usage

From source file:Main.java

protected static boolean isKeyEncrypted(String key) {
    return key.contains("ENCRYPTED");
}

From source file:Main.java

public static boolean isSingleLevel(String path) {
    return !path.contains("/");
}

From source file:Main.java

private static boolean isThereTrash(String title) {
    return title.contains("&#") || title.contains("&") || title.contains(" ");
}

From source file:Main.java

public static String getUsernameFromAddress(String str) {
    if (str.contains("sip:")) {
        str = str.replace("sip:", "");
    }/*from  www .  j  a v  a 2s  .  c  o  m*/
    return str.contains("@") ? str.split("@")[0] : str;
}

From source file:Main.java

public static boolean isContainsPoint(String number) {
    return number.contains(".") ? true : false;
}

From source file:Main.java

public static String filterFirstZero(String str) {
    if (!str.contains(".")) {
        return str.replaceFirst("^0*", "");
    }//from ww w. ja  va  2s  .  co  m
    return str;
}

From source file:Main.java

public static String replaceEmail(String pStr) {
    if (pStr.contains("#")) {
        return pStr.replace("#", "@");
    }//from w  ww  .j av a 2s .co m
    return pStr;
}

From source file:Main.java

private static boolean containsCssJsPic(String url) {
    if (url.contains(".jpg") || url.contains(".css") || url.contains(".js") || url.contains(".png")
            || url.contains(".gif") || url.contains(".jpeg"))
        return true;
    else/*  w  ww  . j  ava2  s.c o m*/
        return false;
}

From source file:Main.java

private static boolean containsDirectory(String name) {
    if (name.contains("/")) {
        return true;
    }/*from w w  w . j  a va 2 s  . c o m*/
    return false;
}

From source file:Main.java

private static String getTimeFormat(String time) {
    return (time.contains("AM") || time.contains("PM")) ? FULL_TIME_FORMAT_AM_PM : FULL_TIME_FORMAT;
}