CharMatcher trimLeadingFrom - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for CharMatcher trimLeadingFrom method.

This code example shows how to use the following methods:trimLeadingFrom
		} 
		return string;
	} 
  
	public static int baseIndentation(String text) {
		return text.length() - INDENTATION_MATCHER.trimLeadingFrom(text).length();
	} 
 
	public static boolean containsNesting(String text) {
		return text.contains("\n" + spaces(baseIndentation(text)+1));
	} 
 
	public static boolean hasContentOnFirstLine(String text) {
		int endOfFirstLine = text.contains("\n") ? text.indexOf('\n') : text.length();
		return StringUtils.isNotBlank(text.substring(0, endOfFirstLine));
	} 
 
	public static String describe(boolean isIndentWithTabs, int indentationSize) {
		return indentationSize + (isIndentWithTabs ? " tab" : " space") + (indentationSize == 1 ? "" : "s");
	} 
5
CodeRank
This code example shows how to use the following methods:trimLeadingFrom
    return SLASH_MATCHER.trimTrailingFrom(url);
  } 
 
  @NotNull 
  public static String trimLeadingSlashes(@NotNull String url) {
    return SLASH_MATCHER.trimLeadingFrom(url);
  } 
 
  public static String trimParameters(@NotNull String url) {
    int end = PARAM_CHAR_MATCHER.indexIn(url);
    return end != -1 ? url.substring(0, end) : url;
  } 
 
  /** 
   * Splits the url into 2 parts: the scheme ("http", for instance) and the rest of the URL. <br/> 
   * Scheme separator is not included neither to the scheme part, nor to the url part. <br/> 
   * The scheme can be absent, in which case empty string is written to the first item of the Pair. 
   */ 
  @NotNull 
  public static Pair<String, String> splitScheme(@NotNull String url) {
4
CodeRank
This code example shows how to use the following methods:trimLeadingFrom
      int lastDollarSign = className.lastIndexOf('$');
      if (lastDollarSign != -1) {
        String innerClassName = className.substring(lastDollarSign + 1);
        // local and anonymous classes are prefixed with number (1,2,3...), anonymous classes are  
        // entirely numeric whereas local classes have the user supplied name as a suffix 
        return CharMatcher.DIGIT.trimLeadingFrom(innerClassName);
      } 
      String packageName = getPackageName();
      if (packageName.isEmpty()) {
        return className;
      } 
 
      // Since this is a top level class, its simple name is always the part after package name. 
      return className.substring(packageName.length() + 1);
    } 
 
    /**  
     * Returns the fully qualified name of the class.  
     *  
     * <p>Behaves identically to {@link Class#getName()} but does not require the class to be 
4
CodeRank
trimLeadingFrom Method Overview
Returns a substring of the input character sequence that omits all characters this matcher matches from the beginning of the string.
See Code Examples for other Guava CharMatcher Methods: