while (i < charLength && pString.charAt(i) == ' ') {
	++i;
}

I think it must be like this.
@jxgzxh111