Last active
September 28, 2018 12:44
-
-
Save wholypantalones/a00475d626569a902509b0967bc8275e to your computer and use it in GitHub Desktop.
White-space string to array using match
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Fiddle: http://jsfiddle.net/wholypantalones/eL6zys0c/ | |
const classString = 'btn-lg btn-block btn-success'; | |
const classArray = classString.match(/\S+/g); | |
//output ["btn-lg", "btn-block", "btn-success"]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment