Answers for "string string between two strings in string c#"

C#
1

get text between two strings c#

public string Between(string STR , string FirstString, string LastString)
    {       
        string FinalString;     
        int Pos1 = STR.IndexOf(FirstString) + FirstString.Length;
        int Pos2 = STR.IndexOf(LastString);
        FinalString = STR.Substring(Pos1, Pos2 - Pos1);
        return FinalString;
    }
Posted by: Guest on August-25-2021

Code answers related to "string string between two strings in string c#"

C# Answers by Framework

Browse Popular Code Answers by Language