[Solved] How to find all words in a string C# [closed]


You will have to do it in a loop, like this:

public static string getBetween(string strSource, string strStart, string strEnd)
    {
        int Start = 0, End = 0;
        StringBuilder stb = new StringBuilder();

        while (strSource.IndexOf(strStart, Start) > 0 && strSource.IndexOf(strEnd, Start + 1) > 0)
        {
            Start = strSource.IndexOf(strStart, Start) + strStart.Length;
            End = strSource.IndexOf(strEnd, Start);
            stb.Append(strSource.Substring(Start, End - Start));

            Start++;
            End++;
        }

        return stb.ToString();
    }

solved How to find all words in a string C# [closed]