Skip to content

Commit

Permalink
Trim header values
Browse files Browse the repository at this point in the history
  • Loading branch information
duhast committed Jun 20, 2024
1 parent fecd138 commit b0af731
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions projects/ngx-csv-parser/src/lib/ngx-csv-parser.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ export class NgxCsvParser {
config: any
) {
const dataArr = [];
const headersArray = csvRecordsArray[0];
const headersArray = csvRecordsArray[0].map((h: string) => h.trim());

const startingRowToParseData = config.header ? 1 : 0;

Expand Down Expand Up @@ -136,7 +136,7 @@ export class NgxCsvParser {
const headers = csvRecordsArr[0];
const headerArray = [];
for (const header of headers) {
headerArray.push(header);
headerArray.push(header.trim());
}
return headerArray;
}
Expand Down

0 comments on commit b0af731

Please sign in to comment.