解决:使用\xa0 (反斜杠xa零)
let date='2023-03-15',
let time='17:50'
console.log(date+'\xa0'+time) //2023-03-15 17:50
//\xa0可以叠加
console.log(date+'\xa0\xa0'+time) //2023-03-15 17:50
解决:使用\xa0 (反斜杠xa零)
let date='2023-03-15',
let time='17:50'
console.log(date+'\xa0'+time) //2023-03-15 17:50
//\xa0可以叠加
console.log(date+'\xa0\xa0'+time) //2023-03-15 17:50
本文标题:拼接字符串时在中间加上空格
本文链接:https://www.haomeiwen.com/subject/lhhkrdtx.html
网友评论