当前位置:网站首页>Small example of regular expression--remove spaces in the middle and on both sides of the string
Small example of regular expression--remove spaces in the middle and on both sides of the string
2022-08-05 06:13:00 【CrazyQiQi】
Remove all spaces from a string using a regular expression
var str = " gs gdjkf gs gfsd ";str = str.trim(); //trim()Only spaces on both sides of the string can be removedvar getNewStr = function(str) { //Remove blanks in the string through regular expressionsvar reg = /^\s+|\s+|\s+$/g; //matches all whitespace at the beginning, end and in betweenstr = str.replace(reg, '')span>; //Replace all matching spaces with ''return str;}getNewStr(str); //What you get at this time is a string without spaces//gsgdjkfgsgfsd边栏推荐
- The spark operator - coalesce operator
- spark source code - task submission process - 5-CoarseGrainedExecutorBackend
- VLAN details and experiments
- Dsf5.0 bounced points determine not return a value
- 快问快答—腾讯云服务器常见问题解答
- 单臂路由与三成交换机
- Spark source code-task submission process-6.1-sparkContext initialization-create spark driver side execution environment SparkEnv
- Getting Started 05 Using cb() to indicate that the current task is complete
- 入职前,没想到他们玩的这么花
- VRRP原理及命令
猜你喜欢

Unity3D中的ref、out、Params三种参数的使用

【Day6】文件系统权限管理 文件特殊权限 隐藏属性

Configuration of TensorFlow ObjecDetectionAPI under Anaconda3 of win10 system

入门文档07 分阶段输出

图片压缩失效问题

spark source code - task submission process - 1-sparkSubmit

Getting Started Document 01 series in order

【Day1】VMware软件安装

Getting Started Document 09 Standalone watch

入门文档04 一个任务依赖另外一个任务时,需要按顺序执行
随机推荐
运维工程师,快来薅羊毛
spark算子-parallelize算子
网络不通?服务丢包?看这篇就够了
网站ICP备案是什么呢?
IP数据包格式(ICMP协议与ARP协议)
Spark source code-task submission process-6.1-sparkContext initialization-create spark driver side execution environment SparkEnv
2020,Laya最新中高级面试灵魂32问,你都知道吗?
【Day8】磁盘及磁盘的分区有关知识
【Day8】Knowledge about disk and disk partition
idea 常用快捷键
The spark operator - coalesce operator
【Machine Learning】1 Univariate Linear Regression
Getting Started Doc 06 Adding files to a stream
入门文档01 series按顺序执行
TCP/IP four-layer model
运维的高光时刻,从智能化开始
网络布线与数制转换
js动态获取屏幕宽高度
spark源码-任务提交流程之-3-ApplicationMaster
小度 小度 在呢!