List of usage examples for java.lang String toLowerCase
public String toLowerCase()
From source file:Main.java
/** * This function filters the input collection and returns a collection of elements ending with specified input (Ignore Case). * @param coll/*from w w w .j a va2 s. c om*/ * @param str * @return Filtered Collection<String> */ public static Collection<String> endsWithStringIgnoreCase(Collection<String> coll, final String str) { Collection<String> list = new ArrayList<String>(); for (String item : coll) { if (item.toLowerCase().endsWith(str.toLowerCase())) { list.add(item); } } return list; }
From source file:Main.java
public static String simplifyName(String chordName) { String chord = chordName; chord = chord.toLowerCase(); // The first letter chord = Character.toString(chord.charAt(0)).toUpperCase() + chord.substring(1); int theChar = chordName.indexOf("/"); if (theChar > -1) { return chord.substring(0, theChar); } else {/*from ww w . j ava2 s . co m*/ return chord; } }
From source file:Main.java
public static String convertLegacyToRFC2253(String dn) { int i = dn.toLowerCase().indexOf(" e="); if (i < 0) i = dn.toLowerCase().indexOf(",e="); if (i > 0) { dn = dn.substring(0, ++i) + "EMAILADDRESS" + dn.substring(++i); }/*from w w w .ja v a 2 s . c om*/ return new X500Principal(dn).getName(X500Principal.RFC2253); }
From source file:Main.java
public static boolean isRotationSupported(String mimeType) { return mimeType == null ? false : mimeType.toLowerCase().equals("image/jpeg"); }
From source file:Main.java
@SuppressLint("DefaultLocale") public static String findSuffix(String path, String[] ss) { path = path.toLowerCase(); for (int i = 0, len = ss.length; i < len; i++) { if (path.endsWith(ss[i].toLowerCase())) { return ss[i]; }/* ww w. j av a 2 s. com*/ } return null; }
From source file:Main.java
/** * Method to convert case of string into camel case. * //w w w . j ava 2 s . c om * @param name * the name * @return the string */ private static String toCamelCase(String name) { name = name.toLowerCase(); String[] parts = name.split(" "); String camelCaseString = parts[0].substring(0, 1).toLowerCase() + parts[0].substring(1); for (int i = 1; i < parts.length; i++) { camelCaseString = camelCaseString + toProperCase(parts[i]); } return camelCaseString; }
From source file:Main.java
public static boolean isInvalidPictureFile(String mimeType) { String lowerCaseFilepath = mimeType.toLowerCase(); return (lowerCaseFilepath.contains("jpg") || lowerCaseFilepath.contains("jpeg") || lowerCaseFilepath.toLowerCase().contains("png") || lowerCaseFilepath.toLowerCase().contains("bmp") || lowerCaseFilepath.toLowerCase().contains("gif")); }
From source file:Main.java
public static String removeSuffixIgnoreCase(String str, String suffix) { if (str != null && str.toLowerCase().endsWith(suffix.toLowerCase())) { return str.substring(0, str.length() - suffix.length()); }/*www . jav a 2 s . c o m*/ return str; }
From source file:Main.java
public static String removePrefixIgnoreCase(String str, String prefix) { if (str != null && str.toLowerCase().startsWith(prefix.toLowerCase())) { return str.substring(prefix.length()); }/*from w w w . j a v a2 s . c om*/ return str; }
From source file:Main.java
/** * Function to check if the present url or string has image formate like JPG , PNG, JPEG * @param imageUrl string // w w w. j a v a 2 s. co m * @return true if the image format is present else return false. */ public static boolean isUrlHasImageFormat(String imageUrl) { return imageUrl != null && (imageUrl.toLowerCase().contains("png") || imageUrl.toLowerCase().contains("jpg") || imageUrl.toLowerCase().contains("jpeg")); }