// Collection of code snippets by Arne Vajhøj // (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) using System; namespace E { class MainClass { public static void Main(string[] args) { string s = "Lorem ipsum dolor sit amet, consectetuer adipiscing elit. In commodo. Mauris nec ipsum. Donec tincidunt. Aliquam erat volutpat. Pellentesque aliquam. Donec interdum malesuada arcu. Duis risus posuere."; int ix = 0; while(ix < s.Length) { int len = Math.Min(20, s.Length - ix); Console.WriteLine(s.Substring(ix, len)); ix += len; } } } }