Contact: aviboots(AT)netvision.net.il
31,167 questions
40,724 answers
573 users
var str = "javascript#"; if (str[str.length - 1] === '#') document.write("yes"); else document.write("no"); /* run: yes */
var str = "javascript#"; if (str.indexOf('#') === str.length - 1) document.write("yes"); else document.write("no"); /* run: yes */
function string_ends_with(s, suffix) { return s.indexOf(suffix, s.length - suffix.length) !== -1; } var str = "javascript#"; if (string_ends_with(str, "#")) document.write("yes"); else document.write("no"); /* run: yes */