List of usage examples for java.lang String contains
public boolean contains(CharSequence s)
From source file:Main.java
public static String getUsernameFromAddress(String address) { if (address.contains("sip:")) address = address.replace("sip:", ""); if (address.contains("@")) address = address.split("@")[0]; return address; }
From source file:Main.java
public static String getXmlString(Node inXml, String xpath) { if (!xpath.contains("/")) { NodeList elements = ((Element) inXml).getElementsByTagName(xpath); if (elements.getLength() == 1) { return elements.item(0).getTextContent(); }// ww w . j a va 2 s . com } try { return xPath.evaluate(xpath, inXml); } catch (Exception ex) { throw new RuntimeException("Could not run xpath: " + xpath, ex); } }
From source file:Main.java
public static String campaignStatusMessage(String status, Date endDate) { if (status.contains("STOPPED")) { return "Stopped"; } else if (isCampaignExpired(endDate)) { return "Expired"; }/* www . ja va2 s. c o m*/ return ""; }
From source file:Main.java
/** * Searches for dynamic namespaces in expression. * @param expression/*from ww w .j av a2 s .c om*/ * @return */ public static boolean hasDynamicNamespaces(String expression) { return expression.contains(DYNAMIC_NS_START) && expression.contains(DYNAMIC_NS_END); }
From source file:Main.java
public static boolean isEmbeddedGallery(String url) { if (url.contains("action=gallery")) { return true; }//from w w w. ja va2s . c o m return false; }
From source file:Main.java
public static void checkValidName(final String iFileName) throws IOException { if (iFileName.contains("..") || iFileName.contains("/") || iFileName.contains("\\")) throw new IOException("Invalid file name '" + iFileName + "'"); }
From source file:Main.java
public static String getCheckNum(String ggaString) { if (!ggaString.contains("$") || !ggaString.contains("*")) return null; String test = ggaString.substring(ggaString.indexOf("$") + 1, ggaString.indexOf("*")); char result = test.charAt(0); for (int i = 1; i < test.length(); i++) result ^= test.charAt(i);/*from w w w .ja va 2 s.co m*/ String bufferString = Integer.toHexString(result); if (bufferString.length() == 1) bufferString = "0".concat(bufferString); return bufferString; }
From source file:Main.java
/** * checks for network authentication errors as well as the service call exceptions * @param response String/*from w w w .j av a 2 s . c o m*/ * @return boolean isValidResult */ public static boolean isValidJsonResult(String response) { return response != null && !response.contains("<HTML") && !response.equals("") && !response.contains("<!DOCTYPE") && !response.contains("/>"); }
From source file:Main.java
public static String preparePathForPicasso(String path) { if (TextUtils.isEmpty(path) || path.contains("https://") || path.contains("http://")) { return path; }// w ww. ja v a 2 s . com return path.startsWith("file:") ? path : "file:" + path; }
From source file:Main.java
public static boolean isAppFilesPath(Context context, String path) { return !TextUtils.isEmpty(path) && path.contains("/Android/data/" + context.getPackageName() + "/files"); }