Finding the filename of a path (or any substring from a string) using javascript

To find the part of a string after the last \ using javascript the following can be used.

alert( this.value.substring(this.value.lastIndexOf("\\")+1) );