[Solved] How to substring from character to end of string?


A crude but working example. you can further improve upon it. Call

    GetEverythingFromThird("https://stackoverflow.com/questions/ask", "https://stackoverflow.com/");

The method:

static string GetEverythingFromThird(string instring, string checkitem)
        {
            string outstring = "";
            //1st occurence
            int index = instring.IndexOf(checkitem);
            outstring = instring.Substring(index + 1);
            //2nd occurence
            index = outstring.IndexOf(checkitem);
            outstring = outstring.Substring(index + 1);
            //3rd occurence
            index = outstring.IndexOf(checkitem);
            outstring = outstring.Substring(index);
            return outstring;
        }

0

solved How to substring from character to end of string?