Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

split by space capital letter or underscore javascript

var str = "HelloWorld good_bye";

str = str.split(/[s_]+|(?=[A-Z])/).join("-");

document.body.innerHTML = str;
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #split #space #capital #letter #underscore #javascript
ADD COMMENT
Topic
Name
5+5 =