Skip to main content

Modify-Column-Name

Command Description

Modify column names of a datatable

Command Prototype

Datatable.ModfiyColumns(dtTable,aryColumns)

Parameter Description

ParameterRequiredTypeDefaultDescription
dtTableTrueexpressionobjDatatableThe data table to be filtered
aryColumnsTrueexpression[]This array will be used to replace the old names of the data column

Demo

aryData = [["a", 1], ["b", 2], ["c", 3], ["d", 1]] 
aryColumns = ["letter", "number"]
objDatatable = Datatable.BuildDataTable(aryData,aryColumns)
Datatable.ModfiyColumns(objDatatable,["l", "n"])

TracePrint(objDatatable)
/*
l n
0 a 1
1 b 2
2 c 3
3 d 1
*/