You can use the LastIndexOf method to get the position of the last / in the string and pass this to the Substring method as the number of characters you want to cut off from the string. This should leave you with Get at the end.
[TestMethod]
public void ShouldResultInGet()
{
string url = "http://schemas.xmlsoap.org/ws/2004/09/transfer/Get";
int indexOfLastSlash = url.LastIndexOf( '/' ) + 1;
Assert.AreEqual( "Get", url.Substring( indexOfLastSlash ) );
}
source
share