MSDotNetBuddy
The blog is to experiment with various technologies.
Search This Blog
2023/07/25
Split string over multiple white spaces
var
sentence
=
" I am sangram desai. "
var
arr
=
sentence
.
trim
().
split
(
/\s
+
/
)
console
.
log
(
arr
)
output:
[ 'I', 'am', 'sangram', 'desai.' ]
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment