You have the right idea just replace the brackets with parentheses.
var string = "/Roland/index.php";
var result = string.substring(string.lastIndexOf("/") + 1);
Here is an example in jsfiddle and here is an explanation of the .lastIndexOf() method on the Mozilla Developer Network.