c# split text into lines code example
Example 1: c sharp split by newline
// To split a string by newlines, see below (requires 'System')
using System
text.Split(new[] { Environment.NewLine }, StringSplitOptions.None);
Example 2: split string into lines
Just use tr command for separating words output into separate lines:
tr -s '[[:punct:][:space:]]' '\n'
Example for
cat file.txt | tr -s '[[:punct:][:space:]]' '\n'