Javascript String split2(s)

Description

Javascript String split2(s)




String.prototype.split2 = function(s) {

    var rg = this.split(s);

    if ((rg.length == 1) && (rg[0] === ''))
        return [];

    return rg;/*from w w  w  . j a v a  2 s . c  o m*/
};



PreviousNext

Related