Information Systems



Javascript split with multiple delimiters

How do you use Javascript split with multiple delimiters?

Use a regular expression.

var a = "2009-12-25 04:00".split(/[\s-]+/);

var month=a[1];
var day=a[2];
var year=a[0];