flip map(a)
Group |
Flips keys and values within map a. The values will be the keys - and the keys are the values instead. Please note: If the values are not unique, a new key (created from these equal values) will contain the last former key as the new value since the previous values will be overwritten.
Description of Parameters
Parameter |
Description |
a |
Name of the map. |
Examples
Map MyMap is set up as
Key |
Value |
Key1 |
Value1 |
Key2 |
Value2 |
After calling the function, map MyMap is:
Key |
Value |
Value1 |
Key1 |
Value2 |
Key2 |
If map MyMap is set up as
Key |
Value |
Key1 |
Value1 |
Key2 |
Value1 |
, map MyMap will be
Key |
Value |
Value1 |
Key2 |