当前位置:网站首页>JS add spaces to the string
JS add spaces to the string
2022-07-07 11:09:00 【Have a good time I】
js String concatenation space , An old question about growth is often forgotten , Let's make a record
requirement : Because the specification configuration is string splicing , As shown in the figure, the specification configuration is required to add spaces to this character
I tried several methods, but they didn't work
1. direct +' '
Direct to ignore , No effect .
2. direct +' '
Put... Directly
Output , Negative effects .
3. direct +'\xa0'
, Direct success , If you need a few spaces, just splice a few '\xa0'
The splicing method of the above figure is as follows :
const specificationConfiguration =
' Resource name :' +
conf.resourceName +'\xa0\xa0\xa0\xa0\xa0\xa0'+
' processor :' +
conf.processor +'\xa0\xa0\xa0\xa0\xa0\xa0'+
' Memory :' +
conf.memory +'\xa0\xa0\xa0\xa0\xa0\xa0'+
' computer network :' +
conf.network +'\xa0\xa0\xa0\xa0\xa0\xa0'+
' Free :' +
conf.freeCpus+' nucleus '
边栏推荐
- Some online academic report websites and machine learning videos
- VR development optimization
- Rolling puddle Uni_ App (VIII)
- Unity websocket server
- Go-Redis 中间件
- The use of list and Its Simulation Implementation
- seata 1.3.0 四种模式解决分布式事务(AT、TCC、SAGA、XA)
- "Dream Cup" 2017 Jiangsu information and future primary school summer camp it expert PK program design questions
- 2022.7.4DAY596
- Multithreaded application (thread pool, singleton mode)
猜你喜欢
SQL Server knowledge gathering 9: modifying data
[recommendation system 01] rechub
【STM32】实战3.1—用STM32与TB6600驱动器驱动42步进电机(一)
I plan to take part in security work. How about information security engineers and how to prepare for the soft exam?
Static semantic check of clang tidy in cicd
[C #] the solution of WinForm operation zoom (blur)
Seata 1.3.0 four modes to solve distributed transactions (at, TCC, Saga, XA)
VR development optimization
从色情直播到直播电商
Is the soft test intermediate useful??
随机推荐
The use of list and Its Simulation Implementation
Kitex 重试机制
How to prepare for the advanced soft test (network planning designer)?
深入理解Apache Hudi异步索引机制
Static semantic check of clang tidy in cicd
Those confusing concepts (3): function and class
IDEA快捷键大全
Kitex retry mechanism
[pyqt] the cellwidget in tablewidget uses signal and slot mechanism
How to get hardware information in unity
Idea shortcut keys
[untitled]
2021-04-08
【安装系统】U盘安装系统教程,使用UltraISO制作U盘启动盘
Mysql的json格式查询
Unity websocket server
Deconstruction and assignment of variables
滚动踩坑--UNI_APP(八)
VR development optimization
"Dream Cup" 2017 Jiangsu information and future primary school summer camp it expert PK program design questions