Export to excel - COMMA issue
- by 6242Y
I want to put a string in an excel sheet from my Export to excel function.
However my string is as follows:
string : Red, red wine Go to my head Make me forget that I Still need
and on my excel I get unexpected results , column change after comma and also column change when there is no full stop in front of an UPPER CASE alphabet.
The Upper case alphabets (without a full stop before them) are also causing this (Go , Make . Still)
How can I solve this issue ?
I tried removing the spaces after the comma as
var desc = "";
if (o.Description.Contains(','))
{
var trimmedSplits = new List<string>();
var splits = o.Description.Split(',');
foreach (var stringBits in splits)
{
desc = desc + stringBits.Trim() + ",";
}
desc = desc.Remove(desc.Length - 1);
}
dtRow[(int)ProductRangeExportToExcel.Description] = desc;