/** * Check if the passed MIME type has the same content type as this * * @param sMimeType * The MIME type string to be checked. May be <code>null</code>. * @return <code>true</code> if the passed MIME type has this content type, * <code>false</code> otherwise */ public boolean isTypeOf (@Nullable final String sMimeType) { return StringHelper.startsWith (sMimeType, m_sText + CMimeType.SEPARATOR_CONTENTTYPE_SUBTYPE); }
/** * Check if the passed resource name is an explicit classpath resource. This * is the case, if the name starts either with {@link #CLASSPATH_PREFIX_LONG} * or {@link #CLASSPATH_PREFIX_SHORT}. * * @param sName * The name to check. May be <code>null</code>. * @return <code>true</code> if the passed name is not <code>null</code> and * an explicit classpath resource. */ public static boolean isExplicitClassPathResource (@Nullable final String sName) { return StringHelper.startsWith (sName, CLASSPATH_PREFIX_LONG) || StringHelper.startsWith (sName, CLASSPATH_PREFIX_SHORT); }
public static boolean isDataAttrName (@Nullable final String sName) { return StringHelper.startsWith (sName, CHTMLAttributes.HTML5_PREFIX_DATA); }
public static boolean isDataAttrName (@Nullable final String sName) { return StringHelper.startsWith (sName, CHTMLAttributes.HTML5_PREFIX_DATA); }
@Nullable public static String getWithoutClassPathPrefix (@Nullable final String sPath) { if (StringHelper.startsWith (sPath, CLASSPATH_PREFIX_LONG)) return sPath.substring (CLASSPATH_PREFIX_LONG.length ()); if (StringHelper.startsWith (sPath, CLASSPATH_PREFIX_SHORT)) return sPath.substring (CLASSPATH_PREFIX_SHORT.length ()); return sPath; }
public static boolean isValidDeclaration (@Nonnull @Nonempty final String sDeclaration) { return StringHelper.startsWith (sDeclaration, '@'); }
public static boolean isValidDeclaration (@Nonnull @Nonempty final String sDeclaration) { return StringHelper.startsWith (sDeclaration, '@'); }
/** * Trim the passed lead from the source value. If the source value does not * start with the passed lead, nothing happens. * * @param sSrc * The input source string * @param sLead * The string to be trimmed of the beginning * @return The trimmed string, or the original input string, if the lead was * not found * @see #trimEnd(String, String) * @see #trimStartAndEnd(String, String) * @see #trimStartAndEnd(String, String, String) */ @Nullable @CheckReturnValue public static String trimStart (@Nullable final String sSrc, @Nullable final String sLead) { return startsWith (sSrc, sLead) ? sSrc.substring (sLead.length (), sSrc.length ()) : sSrc; }
public static boolean isValidDeclaration (@Nonnull @Nonempty final String sDeclaration) { return StringHelper.startsWith (sDeclaration, '@') && StringHelper.endsWithIgnoreCase (sDeclaration, "viewport"); }
public static boolean isValidDeclaration (@Nonnull @Nonempty final String sDeclaration) { return StringHelper.startsWith (sDeclaration, '@') && StringHelper.endsWithIgnoreCase (sDeclaration, "keyframes"); }
public static boolean isValidDeclaration (@Nonnull @Nonempty final String sDeclaration) { return StringHelper.startsWith (sDeclaration, '@') && StringHelper.endsWithIgnoreCase (sDeclaration, "keyframes"); }
public static boolean isValidDeclaration (@Nonnull @Nonempty final String sDeclaration) { return StringHelper.startsWith (sDeclaration, '@') && StringHelper.endsWithIgnoreCase (sDeclaration, "viewport"); }
if (StringHelper.startsWith (sPathToUse, UNIX_SEPARATOR))
/** * Concatenate a base URL and a sub path incl. the path cleansing. More or * less the same as calling <code>getCleanPath (sURL + sPath)</code> * * @param sURL * The base URL. May not be <code>null</code>. * @param sPath * The path to append. May not be <code>null</code>. * @return The combined, cleaned path. * @see #getCleanPath(String) */ @Nonnull public static String getCleanConcatenatedUrlPath (@Nonnull final String sURL, @Nonnull final String sPath) { ValueEnforcer.notNull (sURL, "URL"); ValueEnforcer.notNull (sPath, "Path"); // If nothing is to be appended, just clean the base URL if (StringHelper.hasNoText (sPath)) return getCleanPath (sURL); final String sRealURL = StringHelper.endsWith (sURL, '/') ? sURL : sURL + '/'; final String sRealPath = StringHelper.startsWith (sPath, '/') ? sPath.substring (1) : sPath; return getCleanPath (sRealURL + sRealPath); }
if (!StringHelper.startsWith (aTelNo.getCountryCode (), '+')) ret.append ('+'); ret.append (aTelNo.getCountryCode ()).append ('/'); if (StringHelper.startsWith (aTelNo.getAreaCode (), '0')) ret.append (aTelNo.getAreaCode ().substring (1)); else
if (StringHelper.startsWith (sOrigValue, '[') && StringHelper.endsWith (sOrigValue, ']'))
if (StringHelper.startsWith (sBaseURI, "jar:file:") || StringHelper.startsWith (sBaseURI, "wsjar:file:"))
!StringHelper.startsWith (sAttrName, CHTMLAttributes.HTML5_PREFIX_DATA) && !StringHelper.startsWith (sAttrName, CHTMLAttributes.PREFIX_ARIA) && m_eElement != EHTMLElement.LINK)