Splitting a String
Problem
You want to split a string.
Solution
Use JavaScript’s String split() method:
Discussion
String’s split() is a standard JavaScript method. It can be used to split a string on any delimiter, including regular expressions. It also accepts a second parameter that specifies the number of splits to return.