Is there a javascript function to get the last occurrence of a substring in a String
Like:
var url = "/home/doc/some-user-project/project";
I would like a function that returns true
if the String contains project at his end.
I know str.indexOf()
or str.lastIndexOf()
but is there another function that do the job or should I do it?
Thanks for the answer