I have a long string like
"When I was 10 year old"
I need to pass this string to an array: ["When I was", "10" , "year old"]
.
The integer may be different in different cases, and the sentence may also change.
In short, I want to split the string into an integer. Is this possible?
How can I use regex in conjunction with split in jquery / java-script
source share