* Removes trailing whitespace or specified characters from `string`. * * @static * @memberOf _ * @since 4.0.0 * @category String * @param {string} [string=''] The string to trim. * @param {string} [chars=whitespace] The characters to tri
(string, chars, guard)
| 25609 | * // => '-_-abc' |
| 25610 | */ |
| 25611 | function trimEnd(string, chars, guard) { |
| 25612 | string = toString(string); |
| 25613 | if (string && (guard || chars === undefined)) { |
| 25614 | return string.replace(reTrimEnd, ''); |
| 25615 | } |
| 25616 | if (!string || !(chars = baseToString(chars))) { |
| 25617 | return string; |
| 25618 | } |
| 25619 | var strSymbols = stringToArray(string), |
| 25620 | end = charsEndIndex(strSymbols, stringToArray(chars)) + 1; |
| 25621 | |
| 25622 | return castSlice(strSymbols, 0, end).join(''); |
| 25623 | } |
| 25624 | |
| 25625 | /** |
| 25626 | * Removes leading whitespace or specified characters from `string`. |
nothing calls this directly
no test coverage detected