KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I have the following string str="HelloWorld How areYou I AmFine" I want this string into the following array ["Hello","World How are","You I Am", "Fine"] I have been using the following regex, it splits correctly but it also omits the matching pattern, i also want to retain that pattern. What i get is str.split(/[a-z][A-Z]/) => ["Hell", "orld How ar", "ou I A", "ine"] It omitts the matching pattern. Can any one help me out how to retain these characters as well in the resulting array
Tags (comma-separated)
Save Edits
Cancel