Nishanth Suraj Nishanth Suraj - 1 month ago 10x
ASP.NET (C#) Question

How to find the second last indexof a value in a string?

string referrer = "?404;";

referrer = referrer.Substring(referrer.LastIndexOf("/") + 1);

By doing this I get referrer value
as answer.

I want my referrer value to be "Applications/"

How can I achieve this?

Any help will be greatly appreciated.

referrer = referrer.Substring(referrer.Substring(0, referrer.LastIndexOf("/")).LastIndexOf("/") + 1);