public static String ltrim ( String str , String defaultValue ) { if ( str == null ) return defaultValue ; int len = str . length ( ) ; int st = 0 ; while ( ( st < len ) && ( str . charAt ( st ) <= ' ' ) ) { st ++ ; } return ( ( st > 0 ) ) ? str . substring ( st ) : str ; }
This function returns a string with whitespace stripped from the beginning of str