JSFiddle - React, Tailwind, and code Playground
JavaScript
var testUrl = "http://localhost/#step-99";
var t1 = testUrl;
console.log("t1 = " + t1);
var startIndex = t1.lastIndexOf("step-");
console.log("startIndex = " + startIndex);
var endIndex = t1.length;
console.log("endIndex = " + endIndex);
var tempVal = t1.substr(startIndex, endIndex);
tempVal = tempVal.replace("step-","");
console.log(tempVal);