List of usage examples for java.lang String startsWith
public boolean startsWith(String prefix)
From source file:Main.java
/** * Parse an IDREF, which means, currently, * to remove the trailing "#" if any.//from w ww . ja v a 2 s . c om * @param idref * @return the parsed String */ public static String parse(String idref) { if (idref.startsWith("#")) { idref = idref.substring(1); } return idref; }
From source file:Main.java
public static boolean isEncodedGroup(@NonNull String groupId) { return groupId.startsWith(ENCODED_GROUP_PREFIX); }
From source file:Main.java
/** * Gets the characters name from the filename by stripping the prefix. * @return The characters name if prefixed correctly, null otherwise. *//* w w w .ja v a 2 s .c om*/ public static String getCharacterNameFromFilename(String filename) { if (filename.startsWith(CORE_PREFIX)) { return filename.replace(CORE_PREFIX, ""); } else if (filename.startsWith(FAE_PREFIX)) { return filename.replace(FAE_PREFIX, ""); } return null; }
From source file:Main.java
public static int resolveId(Context context, Resources res, String string) { if (string.startsWith("@")) { String subs = string.substring(1, string.length()); String[] parts = subs.split("/"); if (parts[0].startsWith("+")) parts[0] = parts[0].substring(1); return res.getIdentifier(parts[1], parts[0], context.getPackageName()); }//w w w . j a v a 2 s.c om return Integer.parseInt(string); }
From source file:Main.java
/** * You can verify which runtime is in use by calling System.getProperty("java.vm.version"). * If ART is in use, the property's value is "2.0.0" or higher. * @param java_vm_version "getProperty("java.vm.version")" *///from w ww .j a v a 2 s . com public static String getVMType(String java_vm_version) { if (java_vm_version.startsWith("2.")) { return "ART"; } return "Dalvik"; }
From source file:Main.java
public static boolean isChinaTelecom(String mobile) { return (mobile.startsWith("133") || mobile.startsWith("153") || mobile.startsWith("189") || mobile.startsWith("187") || mobile.startsWith("180")); }
From source file:Main.java
private static String removeQuotesIfPresent(String inputString) { int startIndex = inputString.startsWith("\"") ? 1 : 0; int endIndex = inputString.endsWith("\"") ? inputString.length() - 1 : inputString.length(); return inputString.substring(startIndex, endIndex); }
From source file:Main.java
public static String getDeviceName() { String manufacturer = Build.MANUFACTURER; String model = Build.MODEL; return model.startsWith(manufacturer) ? model : manufacturer + " " + model; }
From source file:Main.java
public static boolean representsNodeElement(String fragment) { return fragment.startsWith(NODE_START); }
From source file:com.toddbodnar.simpleHive.helpers.controlCharacterConverter.java
public static String convertFromReadable(String c) { if (!c.startsWith("CONTROL_")) return c; int controlCharNumber = Integer.parseInt(c.substring(8)); return (char) controlCharNumber + ""; }