Hi all,
I want to trim the column headers of a CSV file, fields below is an array that contains the header names, where would I place trim()? I've placed it with the foreach loop but VS tells me "cannot assign field because it is a foreach iteration variable". What am I doing wrong?
while ((fields = csv.GetCSVLine()) != null)
{
if (header)
{
foreach (string field in fields)
{
//field = field.trim(); //VS: "cannot assign field because it is a foreach iteration variable"
headers.Add(field);
}
}