I have a string that looks like
string url = \"www.example.com/aaa/bbb.jpg\";
\"www.example.com/\" is 18 fixed in length. I want to get th
Your mistake is the parameters to Substring. The first parameter should be the start index and the second should be the length or offset from the startindex.
string newString = url.Substring(18, 7);
If the length of the substring can vary you need to calculate the length.
Something in the direction of (url.Length - 18) - 4 (or url.Length - 22)
In the end it will look something like this
string newString = url.Substring(18, url.Length - 22);