renameColumns
The renameColumns method creates a new table with specified columns renamed.
Syntax
Parameters
| Parameter | Type | Description |
|---|---|---|
| columns | String... | Columns that will be renamed in the new table.
|
| columns | Collection<String> | Columns that will be renamed in the new table.
|
| pairs | MatchPair... | Columns that will be renamed in the new table.
|
Important
If the new column name conflicts with an existing column name in the table, the existing column will be silently replaced.
Returns
A new table that renames the specified columns.
Examples
The following example renames columns A and C:
The following example renames column C to A. Because A already exists, it is silently replaced with the renamed C column: