String Formatting

  • Thread starter Thread starter J
  • Start date Start date
J

J

I have a 512 character string and I need line breaks every few
characters. What's a good way to do this in C#?
 
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.
 
String "\r\n" represents newline in C#. You can use String.Insert property
to insert in in specific place inside the string.

- Huitzilopochtli
 
Back
Top