List of utility methods to do String Split
splitenum(separator)String.prototype.splitenum = function(separator){ var tokens = this.split(separator); var obj = {} for (var i=0; i< tokens.length; i++ ){ obj[i] = tokens[i]; return obj; | |
splitlines(s)String.prototype.splitlines = function(s) { return s.split('\n') | |
rsplit(sep, maxsplit)String.prototype.rsplit = function(sep, maxsplit) { var split = this.split(sep); return maxsplit ? [ split.slice(0, -maxsplit).join(sep) ].concat(split.slice(-maxsplit)) : split; }; | |
rsplit(sep, maxsplit)String.prototype.rsplit = function(sep, maxsplit) { var split = this.split(sep); return maxsplit ? [ split.slice(0, -maxsplit).join(sep) ].concat(split.slice(-maxsplit)) : split; var graphs = []; var URL_SEP = "/"; var blank_uuid = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; function swapLastPart(url, lastPart) { return swapLastParts(url, [lastPart]); ... |