Javascript String beginsWith(t, i)
String.prototype.beginsWith = function(t, i) { if (i == false) { return (t == this.substring(0, t.length)); } else {//from w w w. j a v a 2 s. co m return (t.toLowerCase() == this.substring(0, t.length).toLowerCase()); } };