如何去除字符串中的空格?
摘要:
方法一: //使用trim()方法去除空格let a = 'hello world' a.trim() console.log(a) //helloworld 方法二: //自己写个for循环先转换为数组,再判断数组里数据是否有为空,如果为空就删除。最后再转换为字符串let value = 'hel 阅读全文
posted @ 2021-12-11 23:13 久居我梦 阅读(1058) 评论(0) 推荐(0)
posted @ 2021-12-11 23:13 久居我梦 阅读(1058) 评论(0) 推荐(0)