Nishanth Suraj Nishanth Suraj - 1 year ago 142
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.

Answer Source
referrer = referrer.Substring(referrer.Substring(0, referrer.LastIndexOf("/")).LastIndexOf("/") + 1);
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download