Spanish Cambiar un valor puntual dentro de un Map

Santiago Russo

Member
Licensed User
Buenas, tengo un Map, lo represento como un JSON aquí para más facilidad.
JSON:
{
  "id": 60,
  "user_id": 60,
  "profession_id": 1,
  "ocupation": "null",
  "province_id": 18,
  "work_our_id": 3,
  "working_term_id": 1,
  "computing_level": 1,
  "salary": 100000,
  "travel": 1,
  "gender": null,
  "languages": null
}

Quisiera poder cambiar el valor de la clave "province_id". Cómo puedo lograr eso y conservar los otros datos?
 

josejad

Expert
Licensed User
Longtime User
Si haces map.put(“province_id”, “nueva provincia”) se sobrescribe el valor si existe

Method_636.png
Put (Key As Object, Value As Object) As Object

Puts a key/value pair in the map, overwriting the previous item with this key (if such exists).
Returns the previous item with this key or null if there was no such item.
Note that if you are using strings as the keys then the keys are case sensitive.
Example:
Map1.Put("Key", "Value"
 
Top