for (int i = 30; i < comments.Length; i += 30) { if (comments[i].ToString() == " ") { comments = comments.Remove(i, 1); comments = comments.Insert(i, Environment.NewLine); } else { string newcomments = comments.Substring(0, i); comments.Insert(newcomments.LastIndexOf(' '), Environment.NewLine); } }