J J Oct 28, 2003 #1 I have a 512 character string and I need line breaks every few characters. What's a good way to do this in C#?
I have a 512 character string and I need line breaks every few characters. What's a good way to do this in C#?
N Nicholas Paldino [.NET/C# MVP] Oct 28, 2003 #2 J, I would use a string builder and break apart the string into the chunks that you need. Once you do that, cycle through the chunks, adding in the new line (Environment.NewLine) character(s) as needed. Hope this helps.
J, I would use a string builder and break apart the string into the chunks that you need. Once you do that, cycle through the chunks, adding in the new line (Environment.NewLine) character(s) as needed. Hope this helps.
T Tomo Ferega Oct 28, 2003 #3 String "\r\n" represents newline in C#. You can use String.Insert property to insert in in specific place inside the string. - Huitzilopochtli
String "\r\n" represents newline in C#. You can use String.Insert property to insert in in specific place inside the string. - Huitzilopochtli