admin管理员组文章数量:1134573
By creating a variable
var a = 'something' + ' ' + 'something'
I get this value: 'something something'
.
How can I create a string with multiple spaces on it in JavaScript?
By creating a variable
var a = 'something' + ' ' + 'something'
I get this value: 'something something'
.
How can I create a string with multiple spaces on it in JavaScript?
Share Improve this question edited May 6, 2017 at 9:05 Kishore Sahasranaman 4,2204 gold badges26 silver badges51 bronze badges asked Nov 5, 2015 at 8:32 IstvánIstván 5,12710 gold badges40 silver badges67 bronze badges 2 |7 Answers
Reset to default 161In 2022 - use ES6 Template Literals for this task. If you need IE11 Support - use a transpiler.
let a = `something something`;
Template Literals are fast, powerful, and produce cleaner code.
If you need IE11 support and you don't have transpiler, stay strong
本文标签: htmlHow to create string with multiple spaces in JavaScriptStack Overflow
版权声明:本文标题:html - How to create string with multiple spaces in JavaScript - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736860924a1955911.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
\xa0
code for each ` ` space – Andrew Evt Commented Nov 5, 2015 at 8:33
in html – abbasalim Commented Dec 26, 2022 at 8:14