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

private static Map<String, String> getQueryMapFromUrl(String url) {

    if (url.contains("?")) {
        url = url.split("\\?")[1];
    }//from  w w  w .ja  v a 2  s.  c  o  m

    return getQueryMap(url);
}

From source file:Main.java

public static String getCookie(String siteName, String cookieName) {
    String cookieValue = null;/*from w  w  w  .  j a  va2 s.  c  o m*/

    CookieManager cookieManager = CookieManager.getInstance();
    String cookies = cookieManager.getCookie(siteName);
    String[] temp = cookies.split("[;]");
    for (String ar1 : temp) {
        if (ar1.contains(cookieName)) {
            String[] temp1 = ar1.split("[=]");
            cookieValue = temp1[1];
        }
    }
    return cookieValue;
}

From source file:Main.java

public static boolean isAppCachePath(Context context, String path) {
    return !TextUtils.isEmpty(path) && path.contains("/Android/data/" + context.getPackageName() + "/cache");
}

From source file:Main.java

public static boolean checkGpgga(String checkString) {
    if (!checkString.contains("*"))
        return false;
    if (checkString.indexOf("*") + 4 > checkString.length())
        return false;
    String checkMain = checkString.substring(checkString.indexOf("*") + 1, checkString.indexOf("*") + 3);
    String bufferString = getCheckNum(checkString);
    if (checkMain == null || bufferString == null)
        return false;
    return checkMain.toUpperCase().equals(bufferString.toUpperCase());
}

From source file:Main.java

private static String cleanNetworkTypeName(String type) {
    /*  if (AVUtils.isBlankString(type)) {
      return "offline";/*from  w  w w . j av  a 2s .c om*/
      }*/
    String t = type.toUpperCase();
    if (t.contains("WIFI")) {
        return "WiFi";
    }
    if (type.contains("MOBILE")) {
        return "Mobile";
    }
    return type;
}

From source file:Main.java

public static String preparePathForPicasso(String path) {
    if (TextUtils.isEmpty(path) || path.contains("https://") || path.contains("http://")) {
        return path;
    }//from   w w w. ja  v  a 2  s. c  o  m
    return "file:" + path;
}

From source file:Main.java

public static boolean isSuccess(String url) {
    boolean flag = false;
    if (url.contains("success=\"true\"")) {
        flag = true;//  w w w  .  ja v  a  2s. c  om
    }
    return flag;
}

From source file:Main.java

public static String changleName(String fileName) {
    if (fileName != null && fileName.contains(".pdf")) {
        int index = fileName.indexOf("|") + 1;
        if (index >= 0) {
            fileName = fileName.substring(index, fileName.length());
        }/*www.j a v a2 s . co m*/
    }

    return fileName;
}

From source file:Main.java

private static boolean isDate(Object obj) {

    String fulname = obj.getClass().getName();
    if (fulname.contains("java.util.Date") || fulname.contains("java.sql.Date"))
        return true;

    return false;
}

From source file:com.chiorichan.util.PermissionUtil.java

public static String getLocalName(String permNamespace) {
    if (!permNamespace.contains("."))
        return permNamespace;

    int inx = StringUtils.reverse(permNamespace).indexOf(".");
    return permNamespace.substring(permNamespace.length() - inx);
}