By Ben
Method 1: Function KillSpace (x) {while (x.ley "== ') x = x.substring (1, x.ley); // while x.ley> 0) && (x.Charat (x.length-1) == ')) While (x.length> 0) x = x.substring (0, x.length-1); Alert (" Kill = " x " == ") Return X;} instance: var A = killspace (" abc "); // Depends on a ==" ABC "method 2: string.prototype.trim = function () { Return this.Replace (/ (^ / s ) | / s $ / g, "");} instance: var a = "abc" .trim (); // derived a == "abc"