_.trimEnd(移除尾部空格或指定字符)
语法:
_.trimEnd([string=''], [chars=whitespace])源代码链接:source
npm包链接:npm package
描述:
移除string字符串尾部的 空格 或 指定的字符。
开始版本:4.0.0
参数:
[string=''] (string): 要处理的字符串。[chars=whitespace] (string): 要移除的字符。
返回值:
(string): 返回处理后的字符串。
例子:
_.trimEnd(' abc ');
// => ' abc'
_.trimEnd('-_-abc-_-', '_-');
// => '-_-abc'Last updated
Was this helpful?