Suppose I have a string with the text: \"THIS IS A TEST\". How would I split it every n characters? So if n was 10, then it would display:
\"THIS IS A \"
\"T
You should be able to use a regex for this. Here is an example:
//in this case n = 10 - adjust as needed
List groups = (from Match m in Regex.Matches(str, ".{1,10}")
select m.Value).ToList();
string newString = String.Join(Environment.NewLine, lst.ToArray());
Refer to this question for details:
Splitting a string into chunks of a certain size