Vue add whitespaces in a string
Published at 2024-05-09 20:18:57Viewed 247 times
Professional article
Please reprint with source link
In Vue.js, if you simply add multiple whitespaces in a string, it eventually displays a single whitespace.
//This will display a single whitespace.
'ab c'
If you want to display multiple whitespaces, you could use unicode to represent whitespace.
let str1 = 'ab\u00A0\u00A0\u00A0 c';
let str2 = 'ab\u0020\u0020\u0020 c';
let str3 = 'ab\u3000\u3000\u3000 c';
These will output multiple whitespaces in strings.
0 人喜欢
Comments
There is no comment, let's add the first one.