Javascript String endWith(s)
String.prototype.endWith = function (s) { var d = this.length - s.length; return (d >= 0 && this.lastIndexOf(s) == d) }
String.prototype.endWith = function(s) { if (s == null || s == "" || this.length == 0 || s.length > this.length) return false; if (this.substring(this.length - s.length) == s) return true;//from w w w . j a v a 2 s. c om else return false; return true; }