using System.Collections.Generic;
public static void Main()
string currentUri = "https://app-test.oversi.com.au/12bd985f-0fc1-4464-9ab9-fe515d9a1679/Projects/Details/f88334ce-5af1-4c14-b260-e3e7f7d4eb29";
string tenantId = string.Empty;
List<string> projectIds = new List<string>() { string.Empty, string.Empty, string.Empty, string.Empty, string.Empty };
(tenantId, projectIds[0]) = GetTenantAndProjectFromUri(currentUri);
Console.WriteLine($"tenantId: {tenantId}");
Console.WriteLine($"projectIds[0]: {projectIds[0]}");
public static (string tenantId, string projectId) GetTenantAndProjectFromUri(string uri)
string environmentVariable = "https://app-test.oversi.com.au";
string pathName = uri.Replace(environmentVariable, string.Empty);
var pathArray = pathName[1..].Split('/');
return (pathArray[0], pathArray[pathArray.Length-1]);