The forums ran from 2008-2020 and are now closed and viewable here as an archive.
Home › Forums › Back End › PHP – Remove anything after the last / › Re: PHP – Remove anything after the last /
@KarimCossutti – I just found this on another site
string input = "http://www.somesite.com/somepage.aspx?whatever";
int index = input.LastIndexOf("/");
if (index > 0)
input = input.Substring(0, index); // or index + 1 to keep slash
Frontend Masters is the best place to get it. They have courses on all the most important front-end technologies, from React to CSS, from Vue to D3, and beyond with Node.js and Full Stack.