1 var isSpace = require('./isSpace');
4 * Used by `_.trim` and `_.trimRight` to get the index of the last non-whitespace
5 * character of `string`.
8 * @param {string} string The string to inspect.
9 * @returns {number} Returns the index of the last non-whitespace character.
11 function trimmedRightIndex(string) {
12 var index = string.length;
14 while (index-- && isSpace(string.charCodeAt(index))) {}
18 module.exports = trimmedRightIndex;