string url = http://localhost:55914/tp://dev.dotcom.com/attachments/avatar/Faces9.jpg
I want to remove the substring from localhost until the forward slashes before dev, how can I achieve that?
So the final string should be as follows:
string final = http://dev.dotcom.com/attachments/avatar/Faces9.jpg
string url = @"http://localhost:55914/tp://dev.dotcom.com/attachments/avatar/Faces9.jpg";
var urls = url.Split("//");
string newUrl = urls[0] + "//" + urls[2];
split the string using "//"
and join the splitted first and last value using "//"
This will remove the specified substring
string uri = "http://localhost:55914/tp://dev.dotcom.com/attachments/avatar/Faces9.jpg";
uri = uri.Replace("http://localhost:55914/tp://", string.Empty);
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.