企业🤖AI Agent构建引擎,智能编排和调试,一键部署,支持私有化部署方案 广告
## padEnd + [link](./padEnd "Link to this entry.") + [source](https://github.com/lodash/lodash/blob/4.5.0正式版/lodash.src.js#L12328 "View in source.") + [npm](https://www.npmjs.com/package/lodash.padend "See the npm package.") ``` _.padEnd([string=''], [length=0], [chars=' ']) ``` 如果字符串长度小于 length 则在右侧填充字符。 如果超出长度则截断超出的部分。 ### 参数 1. [string=''] (string) 要填充的字符串 2. [length=0] (number) 填充的长度 3. [chars=' '] (string) 填充字符 ### 返回值 (string) Returns 返回填充后的字符串 ### 示例 ``` _.padEnd('abc', 6); // => 'abc ' _.padEnd('abc', 6, '_-'); // => 'abc_-_' _.padEnd('abc', 3); // => 'abc' ```