src/main/java/org/jboss/util/Strings.java
/**
    * Trim all occurences of the supplied leading character from the given String.
    *
    * @param str the string to check
    * @param checker the character checker
    * @return the trimmed String
    */
Trim all occurences of the supplied leading character from the given String.
@param str the string to check
@param checker the character checker
@return the trimmed String
Trim all occurences of the supplied leading character from the given String . @param str the string to check @param checker the character checker @return the trimmed String
public static String trimLeadingCharacter(String str, CharacterChecker checker)
   {
      if (hasLength(str) == false)
      {
         return str;
      }
      if (checker == null)
         throw new IllegalArgumentException("Null character checker");
      StringBuffer buf = new StringBuffer(str);
      while (buf.length() > 0 && checker.isCharacterLegal(buf.charAt(0)))
      {
         buf.deleteCharAt(0);
      }
      return buf.toString();
   }
public static String trimLeadingCharacter ( String str , CharacterChecker checker ) { if ( hasLength ( str ) == false ) { return str ; } if ( checker == null ) throw new IllegalArgumentException ( "Null character checker" ) ; StringBuffer buf = new StringBuffer ( str ) ; while ( buf . length ( ) > 0 && checker . isCharacterLegal ( buf . charAt ( 0 ) ) ) { buf . deleteCharAt ( 0 ) ; } return buf . toString ( ) ; }
Trim all occurences of the supplied leading character from the given String.
Trim all occurences of the supplied leading character from the given String .