Split String by length

.net, c#, regex, split

Solution

If you're writing Base64 data, try writing

Convert.ToBase64String(bytes, Base64FormattingOptions.InsertLineBreaks);

This will insert a newline every 76 characters

Problem

I have a string value that its length is 5000 + characters long , i want to split this into 76 characters long with a new line at the end of each 76 characters. how woudld i do this in c#?

Original source

Related problems