I need to import a multi-line string into a single cell of CSV
string message = "This is 1st string.
This is 2nd string.
This is 3rd string."
When I try to import string into CSV it splits up in multiple rows. If I remove new line chars from "message" the string is added as single line. I need to add message as it is into a single cell (multi-line into single cell).
I tried following codes:
var regex = new Regex(@"\r\n?|\t", RegexOptions.Compiled);
message= regex.Replace(message, String.Empty);
char lf = (char)10;
message= message.Replace("\n", lf.ToString());
But the message is added to multiple rows in CSV.