XuelesszzZ 94af2b8e7b 6-30-5 | vor 1 Jahr | |
---|---|---|
.. | ||
perf | vor 1 Jahr | |
.travis.yml | vor 1 Jahr | |
COPYING | vor 1 Jahr | |
README.md | vor 1 Jahr | |
index.d.ts | vor 1 Jahr | |
index.js | vor 1 Jahr | |
package.json | vor 1 Jahr | |
test.js | vor 1 Jahr |
String left pad
$ npm install left-pad
const leftPad = require('left-pad')
leftPad('foo', 5)
// => " foo"
leftPad('foobar', 6)
// => "foobar"
leftPad(1, 2, '0')
// => "01"
leftPad(17, 5, 0)
// => "00017"
NOTE: The third argument should be a single char
. However the module doesn't throw an error if you supply more than one char
s. See #28.
NOTE: Characters having code points outside of BMP plan are considered a two distinct characters. See #58.