List of usage examples for java.lang String startsWith
public boolean startsWith(String prefix)
From source file:Main.java
public static boolean isSubscriptionUid(final String uid) { return uid.startsWith("feed/"); }
From source file:Main.java
public static boolean isUserTagUid(final String uid) { return uid.startsWith("user/") && uid.indexOf("/label/") != -1; }
From source file:Main.java
public static String removeBom(String in) { if (in != null && in.startsWith("\ufeff")) { in = in.substring(1);/*from w ww.jav a2 s . c om*/ } return in; }
From source file:Main.java
public static int argb(String hexColorCode) { if (hexColorCode.startsWith("#")) hexColorCode = hexColorCode.substring(1); return (int) Long.parseLong(hexColorCode, 16); }
From source file:Main.java
public static boolean isAssetUrl(String url) { return url != null && url.startsWith("file:///android_asset/"); }
From source file:Main.java
public static String checkSrc(String url, String src) { if (src.startsWith("http")) { url = src;//from w w w . java 2 s . c o m } else { if (src.startsWith("/")) { url = url + src; } else { url = url + "/" + src; } } return url; }
From source file:Main.java
public static boolean isPlatformClassName(String name) { return name.startsWith("java.") || name.startsWith("javax.") || name.startsWith("sun."); }
From source file:Main.java
public static boolean isTagUid(final String uid) { return uid.startsWith("user/") && (uid.indexOf("/state/") != -1 || uid.indexOf("/label/") != -1); }
From source file:Main.java
public static String normalizePhoneNumber(String phoneNumber) { if (phoneNumber.startsWith("+86")) return phoneNumber.substring(3); if (phoneNumber.startsWith("86")) return phoneNumber.substring(2); return phoneNumber; }
From source file:Main.java
public static String addSetString(String fieldName) { if (fieldName.startsWith("is")) { return fieldName.replace("is", "set"); }/* w ww. ja v a 2s.com*/ StringBuffer sb = new StringBuffer(); sb.append("set"); sb.append(fieldName.substring(0, 1).toUpperCase()); sb.append(fieldName.substring(1)); return sb.toString(); }