去除字符串的头尾空格:
输出结果:
Runoob
trim() 方法用于删除字符串的头尾空格。
trim() 方法不会改变原始字符串。
详情链接https://www.runoob.com/jsref/jsref-trim.html
JavaScript trim() 方法
原文:https://www.cnblogs.com/if41/p/12465187.html