Answers for "c# string split carriage return"

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
1

c# string split by length

static IEnumerable<string> Split(string str, int chunkSize)
{
    return Enumerable.Range(0, str.Length / chunkSize)
        .Select(i => str.Substring(i * chunkSize, chunkSize));
}
Posted by: Guest on November-24-2021

C# Answers by Framework

Browse Popular Code Answers by Language