diff --git a/static/js/script.js b/static/js/script.js index f990811..890781e 100644 --- a/static/js/script.js +++ b/static/js/script.js @@ -217,3 +217,8 @@ function convertHtml(str) { String.prototype.startsWith = function(str) {return (this.match("^"+str)==str)} + +String.prototype.endsWith = function(suffix) { + if (this.length < suffix.length) return false; + return this.lastIndexOf(suffix) === this.length - suffix.length; +}