View In TPC Matrix
Technical Problem Cluster First Answered On
June 15, 2022
Contributions From The
Grepper Developer Community
how to split by multiple elements js
split string into same characters js
split array into chunks
split text on several separators
js split array into two arrays
View Full Screen
> var myString="this,is.a_test" > console.log(myString.split(/[,._]/)); < ["this","is","a","test"] //This uses a regular expression (contained in /foo/). //It will match any character included in the  set.
Link to this answer
Contributed on Jun 15 2022
9 Answers Avg Quality 7/10
Search Code Snippets
Plans & Pricing
Adding a Code Snippet
Viewing & Copying Snippets
Register to vote on and add code examples. Join our developer community to improve your dev skills and code like a boss!
Help us improve our code examples by registering to vote on and add answers. Join our developer community to improve your dev skills and code like a boss!
Continue with Google
By continuing, I agree that I have read and agree to Greppers's
Terms of Service