List of usage examples for java.lang String toLowerCase
public String toLowerCase()
From source file:com.nesscomputing.syslog4j.util.OSDetectUtility.java
private static boolean isMatch(String[] platforms) { boolean match = false; String osName = System.getProperty("os.name"); if (!StringUtils.isBlank(osName)) { osName = osName.toLowerCase(); for (int i = 0; i < platforms.length; i++) { String platform = platforms[i].toLowerCase(); if (osName.indexOf(platform) > -1) { match = true;// w w w.j av a 2s . com break; } } } return match; }
From source file:Main.java
/** * Checks the GL_EXTENSIONS String for the given "extension". This method must only be called when a valid context * and surface is valid./*w w w.j a va2 s . co m*/ * * @param extension * @return boolean */ public static boolean hasExtension(String extension) { String extensions = GLES20.glGetString(GLES20.GL_EXTENSIONS); boolean foundExtension = false; if (extensions != null) { foundExtension = extensions.toLowerCase().contains(extension.toLowerCase()); } return foundExtension; }
From source file:Main.java
private static String parseASX(String inputResource) { String inputFile = ""; try {// w ww . j a va 2s.c om String contents = readTextFromUrl(new URL(inputResource)); for (String line : contents.split("\n")) { if (line.toLowerCase().contains("href")) { String pattern = "(?i).*href=\"(.*)\".*"; inputFile = line.replaceAll(pattern, "$1"); break; } } } catch (MalformedURLException e) { e.printStackTrace(); } return inputFile; }
From source file:Main.java
private static String parseXSPF(String inputResource) { String inputFile = ""; try {//ww w .j a v a2s. co m String contents = readTextFromUrl(new URL(inputResource)); for (String line : contents.split("\n")) { if (line.toLowerCase().contains("href")) { String pattern = "(?i)<location>(.*)</location>.*"; inputFile = line.replaceAll(pattern, "$1"); break; } } } catch (MalformedURLException e) { e.printStackTrace(); } return inputFile; }
From source file:Main.java
static public boolean containsStringLowerCase(final String string_1, final String string_2) { if ((string_1 != null) && (string_2 != null) && (string_1.length() > 0) && (string_2.length() > 0)) { // mgm 140926 return (string_1.toLowerCase().indexOf(string_2.toLowerCase()) >= 0); }//from w w w. j a v a 2s. c om return false; }
From source file:org.xaloon.wicket.component.application.AbstractWebApplication.java
public static boolean isAgent(final String agent) { if (agent != null) { final String lowerAgent = agent.toLowerCase(); for (final String bot : BOT_AGENTS) { if (lowerAgent.indexOf(bot) != -1) { return true; }/* ww w . j av a2 s . c o m*/ } } return false; }
From source file:com.github.jknack.amd4j.Minifier.java
/** * Get a minifier by name.//from w ww .jav a2 s. c om * * @param name The minifier name. * @return A minifier. */ public static Minifier get(final String name) { notEmpty(name, "The name is required."); Minifier minifier = registry.get(name.toLowerCase()); if (minifier == null) { throw new IllegalArgumentException("No minifier/optimizer found for: " + name); } return minifier; }
From source file:Main.java
static public String getTagContentFromPosition_old(String inputTXT, String tag) { String content = ""; String tagStart = "<" + tag.toLowerCase() + ">"; int idx_tagStart = inputTXT.indexOf(tagStart); // System.out.println(tagStart); if (idx_tagStart == -1) { tagStart = "<" + tag.toUpperCase() + ">"; idx_tagStart = inputTXT.indexOf(tagStart); // System.out.println(tagStart); }/*from www . j a v a 2 s . co m*/ if (idx_tagStart == -1) { tagStart = "<" + tag.toLowerCase() + " "; idx_tagStart = inputTXT.indexOf(tagStart); // System.out.println(tagStart); } if (idx_tagStart == -1) { tagStart = "<" + tag.toUpperCase() + " "; idx_tagStart = inputTXT.indexOf(tagStart); // System.out.println(tagStart); } if (idx_tagStart == -1) { tagStart = "<" + tag.toLowerCase() + "\t"; idx_tagStart = inputTXT.indexOf(tagStart); // System.out.println(tagStart); } if (idx_tagStart == -1) { tagStart = "<" + tag.toUpperCase() + "\t"; idx_tagStart = inputTXT.indexOf(tagStart); // System.out.println(tagStart); } if (idx_tagStart != -1) { int idx_contentStart = inputTXT.indexOf(">", idx_tagStart); if (idx_contentStart != -1) { String tagEnd = "</" + tag.toLowerCase() + ">"; int idx_tagEnd = inputTXT.indexOf(tagEnd, idx_contentStart); if (idx_tagEnd == -1) { tagEnd = "</" + tag.toUpperCase() + ">"; idx_tagEnd = inputTXT.indexOf(tagEnd, idx_contentStart); } if (idx_tagEnd != -1) { content = inputTXT.substring(idx_contentStart + 1, idx_tagEnd); } } } // System.out.println("Content is:" + content); return content; }
From source file:Main.java
public static String byteToHexString(byte[] b) { StringBuffer hexString = new StringBuffer(); for (byte b2 : b) { String hex = Integer.toHexString(b2 & MotionEventCompat.ACTION_MASK); if (hex.length() == 1) { hex = '0' + hex; }//from w w w . j a va 2 s.c om hexString.append(hex.toLowerCase()); } return hexString.toString(); }
From source file:com.upnext.blekit.EventOccurenceUnit.java
@JsonCreator public static EventOccurenceUnit forValue(String value) { if (value == null) return TOTAL; EventOccurenceUnit event = namesMap.get(value.toLowerCase()); if (event == null) return TOTAL; return event; }