How can I check if a string ends with a particular character in JavaScript?
Example: I have a string
var str = \"mystring#\";
I wa
Just another quick alternative that worked like a charm for me, using regex:
// Would be equivalent to: // "Hello World!".endsWith("World!") "Hello World!".match("World!$") != null