pad - string padding on both sides
This commit is contained in:
3
test/pad/pad.js
Normal file
3
test/pad/pad.js
Normal file
@ -0,0 +1,3 @@
|
||||
const pad = (string, length = 8, char = ' ') =>
|
||||
string.padStart((string.length + length) / 2, char).padEnd(length, char);
|
||||
module.exports = pad;
|
||||
Reference in New Issue
Block a user