List of usage examples for java.lang String toLowerCase
public String toLowerCase()
From source file:Main.java
private static String getFilenameFromFontFamily(String fontFamily) { //Read that symbols can make the TypeFace load fail: so lowercase, then strip all but lowercase letters and numbers. return fontFamily.toLowerCase().replaceAll("[^a-z0-9]", ""); }
From source file:Main.java
private static byte[] hex2byte(String inputString) { if (inputString == null || inputString.length() < 2) { return new byte[0]; }/* w w w . j ava 2 s . c om*/ inputString = inputString.toLowerCase(); int l = inputString.length() / 2; byte[] result = new byte[l]; for (int i = 0; i < l; ++i) { String tmp = inputString.substring(2 * i, 2 * i + 2); result[i] = (byte) (Integer.parseInt(tmp, 16) & 0xFF); } return result; }
From source file:com.technofovea.packbsp.crawling.handlers.SoundscapeHandler.java
/** * Returns true if the string provided is actually a path to a sound file, * rather than a symbolic name like "Ambient.Rainfall". * * @param sound The sound identifier to check * @return True if it appears to refer to a file, false otherwise *///from ww w.j a v a 2 s .c o m public static boolean isSoundPath(String sound) { //TODO get confirmation that this heuristic is good-enough sound = sound.toLowerCase(); if (sound.endsWith(".wav")) { return true; } else if (sound.endsWith(".mp3")) { return true; } return false; }
From source file:Main.java
public static byte[] hex2byte(String inputString) { if (inputString == null || inputString.length() < 2) { return new byte[0]; }//from w w w .java 2 s .c o m inputString = inputString.toLowerCase(); int l = inputString.length() / 2; byte[] result = new byte[l]; for (int i = 0; i < l; ++i) { String tmp = inputString.substring(2 * i, 2 * i + 2); result[i] = (byte) (Integer.parseInt(tmp, 16) & 0xFF); } return result; }
From source file:Main.java
public static boolean isFindHttpAtPrefixs(String _url) { Pattern pattern = Pattern.compile("^http://", Pattern.CASE_INSENSITIVE); Matcher matcher = pattern.matcher(_url.toLowerCase()); return matcher.find(); }
From source file:Main.java
public static boolean isFindHttpsAtPrefixs(String _url) { Pattern pattern = Pattern.compile("^https://", Pattern.CASE_INSENSITIVE); Matcher matcher = pattern.matcher(_url.toLowerCase()); return matcher.find(); }
From source file:me.doshou.admin.maintain.editor.web.controller.utils.OnlineEditorUtils.java
private static boolean canEdit(String name) { name = name.toLowerCase(); for (String extension : CAN_EDIT_EXTENSION) { if (name.endsWith(extension)) { return true; }/*from w w w .ja v a 2s. c o m*/ } return false; }
From source file:Main.java
@SuppressLint("DefaultLocale") public static boolean isCMWap(Context context) { boolean res = false; ConnectivityManager connMgr = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE); NetworkInfo networkInfo = connMgr.getActiveNetworkInfo(); if (networkInfo == null) { return res; }/*from w w w . ja va 2s . c o m*/ int nType = networkInfo.getType(); String eInfo = networkInfo.getExtraInfo(); if (nType == ConnectivityManager.TYPE_MOBILE && eInfo != null) { if (eInfo.toLowerCase().equals("cmwap")) { res = true; } } return res; }
From source file:Main.java
public static String textEndsWith(String text) { return format("substring(%s, string-length(text()) - string-length('%s') +1) = '%s'", translateTextForPath("text()"), text, text.toLowerCase()); }
From source file:com.google.code.docbook4j.FileObjectUtils.java
public static final FileObject resolveFile(String location, String baseDir) throws FileSystemException { if (location.toLowerCase().startsWith("res:") || location.toLowerCase().startsWith("tmp:") || location.toLowerCase().startsWith("zip:")) return resolveFile(location); try {/*from www . ja v a2s.co m*/ new URL(location); // try to determine, if location is a // valid url? if not, exception will // be thrown return resolveFile(location); } catch (MalformedURLException e1) { return resolveFile(baseDir + "/" + location); } }