December 2013
Intermediate to advanced
384 pages
9h 54m
English
var s1 = "on-the-way-to-the/forum"; var arr = s1.split("-"); // arr = ["on", "the", "way", "to", "the","forum"];
To split a string into chunks using a specific delimiter, use the .split(separator [, limit]). The separator defines where to split the string and is not included in the results. The limit specifies the number of items to return before stopping. An array of the split portions of the string is returned.
Read now
Unlock full access