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
You need to check your statement like this :
string url = "www.example.com/aaa/bbb.jpg"; string lenght = url.Lenght-4; if(url.Lenght > 15)//eg 15 { string newString = url.Substring(18, lenght); }