MCPcopy
hub / github.com/lodash/lodash / trimmedEndIndex

Function trimmedEndIndex

lodash.js:1365–1370  ·  view source on GitHub ↗

* Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace * character of `string`. * * @private * @param {string} string The string to inspect. * @returns {number} Returns the index of the last non-whitespace character.

(string)

Source from the content-addressed store, hash-verified

1363 * @returns {number} Returns the index of the last non-whitespace character.
1364 */
1365 function trimmedEndIndex(string) {
1366 var index = string.length;
1367
1368 while (index-- && reWhitespace.test(string.charAt(index))) {}
1369 return index;
1370 }
1371
1372 /**
1373 * Used by `_.unescape` to convert HTML entities to characters.

Callers 2

baseTrimFunction · 0.85
trimEndFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected