📌  相关文章
📜  javascript 删除字符串末尾的空格 - Javascript 代码示例

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

代码示例1
const stringWithSpaces = '   I learn JS with Coderslang every day   ';

console.log(stringWithSpaces.trimStart());  //'I learn JS with Coderslang every day   '
console.log(stringWithSpaces.trimEnd());    //'   I learn JS with Coderslang every day'
console.log(stringWithSpaces.trim());       //'I learn JS with Coderslang every day'