📜  字符串 padStart padEnd - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:03:21.858000             🧑  作者: Mango

代码示例1
let string = ‘Alice’; 
// padStart() — we assume our string needs to have 10 characters 
string.padStart(10, ‘o’); // returns ‘oooooAlice’
// padEnd() 
string.padEnd(10, ‘o’); // returns ‘Aliceooooo’;