/// 08/04/2022 Mahesh Kumar Yadav. <br/>
/// <summary>
/// Read file and split line one by one
/// </summary>
internal static void ReadFileAndSplitByLine(string filePath)
{
using (var streamReader = File.OpenText(filePath))
{
var text = streamReader.ReadToEnd();
var lines = text.Split(new[] { Environment.NewLine }, StringSplitOptions.None);
foreach (var line in lines)
{
Console.WriteLine(line);
}
}
}
string[] lines = theText.Split(
new string[] { "
", "
", "
" },
StringSplitOptions.None
);
List<string[]> list = File.ReadLines("YourFile.txt")
.Select(r => r.TrimEnd('#'))
.Select(line => line.Split(','))
.ToList();