#include <iostream>
using std::cout;
int main() {
std::string url = "https://www.website.com/abc/xyz";
int pos = url.rfind("/");
if (pos != std::string::npos) {
url = url.substr(0, url.rfind("/"));
cout << url;
}
else {
cout << "not found";
}
}
/*
run:
https://www.website.com/abc
*/