code: private static int findStartTrimWhitespace(CharSequence s)
     {
        final int len = s.length();
        for (int i = 0; i < len; i++)
        {
           if (!Character.isWhitespace(s.charAt(i)))
           {
              return i;
           }
        }
        return len;
     }
docs: Finds and returns the start of the given sequence after trimming
  whitespace characters from the left.
  
  @param s
  the character sequence
  @return the index containing the first non-whitespace character, or the
  length of the character sequence if all characters are blank