I have an input string which data is coming in the following format: 

* "http://testing/site/name/lists/tasks"
* "http://testing/site/name1/lists/tasks"
* "http://testing/site/name2/lists/tasks" etc.,

How can I extract only name, name1, name2, etc. from this string?

Here is what I have tried:

```
SiteName = (Url.Substring("http://testing/site/".Length)).Substring(Url.Length-12) 

```

It is throwing an exception stating `StartIndex` cannot be greater than the number of characters in the string. What is wrong with my expression? How can I fix it? Thanks.