trimEnd

最后更新于:2022-04-02 00:07:45

## trimEnd + [link](./trimEnd "Link to this entry.") + [source](https://github.com/lodash/lodash/blob/4.5.0正式版/lodash.src.js#L12857 "View in source.") + [npm](https://www.npmjs.com/package/lodash.trimend "See the npm package.") ``` _.trimEnd([string=''], [chars=whitespace]) ``` 移除字符串后面的空白 或 指定的字符。 ### 参数 1. [string=''] (string) 要处理的字符串 2. [chars=whitespace] (string) 要处理的字符 ### 返回值 (string) 返回处理后的字符串 ### 示例 ``` _.trimEnd(' abc '); // => ' abc' _.trimEnd('-_-abc-_-', '_-'); // => '-_-abc' ```
';