I have C# code that loops through a list of records from a database and inserts them in a
numbered list such as:
1. My First Line
2. My Second Line
3. My Third Line
etc...
Some of these records have non-printable characters which are '\n', the newline character. If
such a record has text such as:
"I have a cat\n I have a dog \n I have a horse"
When my code creates the list this record should appear in the document as:
1. I have a cat
I have a dog
I have a horse
2. Next record
3. Next record
etc
Instead it appears as:
1. I have a cat
2. I have a dog
3. I have a horse
4. Next record
5. Next record
etc
Right now I have the following code to strip out the '\n':
myString = myString.Replace('\n', ' ');
However that makes the list look like this:
1. I have a cat I have a dog have a horse
2. Next record
3. Next record
etc
When in Word, I would type a Shift+Enter to get that line break. How can I do that when
creating my list? What do I need to replace the '\n' with and get the proper line break that
does not increment the number in the list?