Answers for "in a string get string between two characters 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 "in a string get string between two characters c#"

C# Answers by Framework

Browse Popular Code Answers by Language