Split On New Lines - CSharp System

CSharp examples for System:String Split

Description

Split On New Lines

Demo Code


using System.Text.RegularExpressions;
using System.Linq;
using System.Collections.Generic;
using System;//from  w w w.j  av a2s .  c  o m

public class Main{
        public static IEnumerable<string> SplitOnNewLines(this string strSource)
        {
            return strSource.Split(new[] {"\r\n", "\n"}, StringSplitOptions.RemoveEmptyEntries);
        }
}

Related Tutorials