src/aria/utils/String.js
function (str, start, end, regexp) {
            var currentCharPos = start, whiteRegexp = regexp || /\s/, currentChar;
            while (currentCharPos < end) {
                currentChar = str.charAt(currentCharPos);
                if (whiteRegexp.test(currentChar)) {
                    return currentCharPos;
                }
                currentCharPos++;
            }
            return -1;
        }
function (str, start, end, regexp) {
            var currentCharPos = start, whiteRegexp = regexp || /\s/, currentChar;
            while (currentCharPos < end) {
                currentChar = str.charAt(currentCharPos);
                if (whiteRegexp.test(currentChar)) {
                    return currentCharPos;
                }
                currentCharPos++;
            }
            return -1;
        }
function ( str , start , end , regexp ) { var currentCharPos = start , whiteRegexp = regexp || / \s / , currentChar ; while ( currentCharPos < end ) { currentChar = str . charAt ( currentCharPos ) ; if ( whiteRegexp . test ( currentChar ) ) { return currentCharPos ; } currentCharPos ++ ; } return - 1 ; }
Find next white space in the given string after start position and before end position
@param {String} str The string into which we search
@param {Integer} start The position in str at which we should begin the search (included)
@param {Integer} end The position in str at which we should end the search (excluded)
@param {RegExp} regexp The regular expression used to recognize a white space. If not provided, /\s/ is used.
@return {Integer} the position of the whitespace in str (between start and end), or -1 if it was not found
Find next white space in the given string after start position and before end position