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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Back
Top