Just a quick question about the split function
How can I split my line in every second space?
myArray = 'This is a sample sentence that I am using'
myArray = myString.split(" ");
I would like to create an array like this
This is a <2 spaces
sample sentence that <2 spaces
that I am <2 spaces
and if the last word is not space, how would I deal with it ...?
any help would be appreciated
source
share