using System; using System.Linq; using System.Text.RegularExpressions; public class Test { public static void Main() { var str = "This is a really long test string is this is this is this is this is this is this is thisit is this this has to be way more than 85 characters ssssssssssss"; Console.WriteLine(Regex.Replace(str, @"(?s).{0,85}", m => m.Value.EndsWith("\n") ? m.Value + "\t" : m.Value + "\n\t")); } }