CSharp · Console
using System;
public class Program
{
public static void Main()
{
string url = "https://www.example.com/site/country/home/products";
string rest = url.Substring(url.IndexOf("/products"));
Console.WriteLine(rest);
url = "https://www.example.com/site/country/home/products/consumer";
rest = url.Substring(url.IndexOf("/products"));
Console.WriteLine(rest);
url = "https://www.example.com/site/country/home/products/consumer/kids";
rest = url.Substring(url.IndexOf("/products"));
Console.WriteLine(rest);
}
}