当前位置:网站首页>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 '
边栏推荐
- Arduino board description
- Use of dotween
- Deep understanding of Apache Hudi asynchronous indexing mechanism
- Unity script visualization about layout code
- [OneNote] can't connect to the network and can't sync the problem
- 【STM32】实战3.1—用STM32与TB6600驱动器驱动42步进电机(一)
- When initializing 'float', what is the difference between converting to 'float' and adding 'f' as a suffix?
- Bookmarking - common website navigation for programmers
- 基于STC8G1K08的0.96寸IIC液晶屏驱动程序
- Which securities company is the best and safest to open an account for the subscription of new shares
猜你喜欢
随机推荐
After the uniapp jumps to the page in onlaunch, click the event failure solution
[pyqt] the cellwidget in tablewidget uses signal and slot mechanism
Online hard core tools
深入理解Apache Hudi异步索引机制
Use of dotween
Unity websocket server
[untitled]
Deep understanding of Apache Hudi asynchronous indexing mechanism
Poj1821 fence problem solving Report
Arduino receives and sends strings
[recommendation system 01] rechub
[OneNote] can't connect to the network and can't sync the problem
在线硬核工具
SQL Server knowledge collection 11: Constraints
Simple and easy to modify spring frame components
Unity script visualization about layout code
What does intermediate software evaluator test
CSAPP bomb lab parsing
Get pictures through opencv, change channels and save them
Force buckle 1002 Find common characters




![[machine learning 03] Lagrange multiplier method](/img/14/7d4eb5679606e272f137ddbda4938c.png)




