function isNumeric(string) { return !isNaN(string); } function sltrim() { return this.replace(/^\s+/,''); } function srtrim() { return this.replace(/\s+$/,''); } function strim() { return this.replace(/^\s+/,'').replace(/\s+$/,''); } String.prototype.ltrim = sltrim; String.prototype.rtrim = srtrim; String.prototype.trim = strim; function print(aString) { Response.write(aString); } function burst(aString, aDelimiter, aFieldList) { var eachItem, eachField, fieldArray, dataArray, i = 0; dataObject = arguments[4] || new Object(); fieldArray = aFieldList.split(" "); dataArray = aString.split(aDelimiter); if (arguments[3]) {dataArray.reverse();} for (eachItem in fieldArray) { eachField = fieldArray[eachItem]; dataObject[eachField] = dataArray[i++].trim(); } i = dataArray.slice(i); if (arguments[3]) {i.reverse();} dataObject.leftovers = i.join(aDelimiter); return dataObject; } /* // burst - returns an object with each of the items in the string // split by the delimeter into properties named from the field list. // Example: var i = burst("a,b,c,d",",","1 2 3 4") print(i); // '[Object]' for (eachParam in i) {print(", "+eachParam+"="+i[eachParam]);} // , 1=a, 2=b, 3=c, 4=d // additional (optional) arguments: // a true or false value for forward or reverse operation // a reference to an existing object, instead of always creating an object */