What if we need to retain the order of the key/value pairs in the map? The only way I can think of is to loop through each pair and change the key directly, but not really sure if it is a good approach.
for (auto& pair : yourTMap)
{
if (pair.Key == keyToReplace)
{
pair.Key = FString("new key value");
break;
}
}
EDIT:
Although my approach would change the key, this would be useless since the new key is not hashed and it wouldn’t be possible to search the map with that key. Is there a way to re-hash the table after changing the key value?