The trimLeading method trims all leading white space from the beginning of the TextData object on which you are invoking the method forward to the first non-white-space character.
The white space characters are those returned from Character.isWhitespace(). TrimLeading does not use the current offset to limit the conversion. It changes the current offset only if it was in the white space it trims off. In that case the method sets the current offset to the beginning of the text.
@return the current TextData