Answers for "c# how to split by \n"

C#
3

c sharp split by newline

// To split a string by newlines, see below (requires 'System')
using System

text.Split(new[] { Environment.NewLine }, StringSplitOptions.None);
Posted by: Guest on February-24-2020
0

read all lines split C#

List<string[]> list = File.ReadLines("YourFile.txt")
                          .Select(r => r.TrimEnd('#'))
                          .Select(line => line.Split(','))
                          .ToList();
Posted by: Guest on November-02-2021

C# Answers by Framework

Browse Popular Code Answers by Language