Answers for "find text and get line in string with c#"

C#
1

How to search for a string from readline in c#

string s = "abc";//string to be searched
//'line' is the storing the line which is read
if(line.Contains(s))
{
   //action to be performed
}
Posted by: Guest on May-16-2020
0

c# C# read text from a certain line number from string

string GetLine(string text, int lineNo) 
{ 
  string[] lines = text.Replace("\r","").Split('\n'); 
  return lines.Length >= lineNo ? lines[lineNo-1] : null; 
}
Posted by: Guest on December-12-2020

Code answers related to "find text and get line in string with c#"

C# Answers by Framework

Browse Popular Code Answers by Language