AI写作智能体 自主规划任务,支持联网查询和网页读取,多模态高效创作各类分析报告、商业计划、营销方案、教学内容等。 广告
## 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' ```