Wednesday, 11 September 2013

Split a string by integer in it using jquery

Split a string by integer in it using jquery

I have long string like
"When I was 10 year old"
I have to get this string split to an array: ["When I was", "10" , "year
old"].
The integer can be different in different cases and the sentence may also
change.
In short i want to split a string by integer in it Is it possible?
How can i use regex in conjugation with split in Jquery/java-script

No comments:

Post a Comment