Jon Erickson Jon Erickson - 1 year ago 122
Javascript Question

JavaScript or jQuery string ends with utility function

what is the easiest way to figure out if a string ends with a certain value?

Answer Source

you could use Regexps, like this:

str.match(/value$/)

which would return true if the string has 'value' at the end of it ($).

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download