1 /** Used to match a single whitespace character. */
2 var reWhitespace = /\s/;
5 * Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace
6 * character of `string`.
9 * @param {string} string The string to inspect.
10 * @returns {number} Returns the index of the last non-whitespace character.
12 function trimmedEndIndex(string) {
13 var index = string.length;
15 while (index-- && reWhitespace.test(string.charAt(index))) {}
19 module.exports = trimmedEndIndex;