read lines after specific string by c#
c#, string
Solution
You can use LINQ:
var result = lines.SkipWhile(x => x != "<rs:data>") // skips everything before
.Skip(1) // and <rs:data> itself
.TakeWhile(x => x != "</rs:data>") // and take up to </rs:data>
.ToList(); // as List<string>
Problem
how to read lines after specific string and end reading when reach specific string this is my text file ``` bla bla bla bla bla bla bla bla vasdasdasd <rs:data> please read me se please read me gr please read me ew please read me se please read me cg </rs:data> saddsagkobn bla bla bla ``` if i use this code ``` string[] lines = System.IO.File.ReadAllLines(@"C:\temp\mytext.txt"); ``` it will read all the lines how to read lines between `<rs:data>` and `</rs:data>` ????