Extraer dato de Json

Hola, necesito ayuda con una duda, hago un Deserialize json y obtengo la variable outJson(JObject), esa variable contiene colores asociados a un número(“01”:“BLANCO”, “02”:“NEGRO”, “03”:“AZUL”, …).
Tengo otra variable, numTexto(String), que almacena numeros que aparecen en un texto.
¿Cómo dar como valor a la variable numColor(String) el color asociado al número de la variable “outJson”?
Gracias.

@albertomachuca
have a look here:

JsonConvert.DeserializeObject(Of Dictionary(Of String, String))(“{”“01"”:““BLANCO””,““02"”:”“NEGRO”“}”)
JsonConvert.DeserializeObject(Of Dictionary(Of String, String))(YourJsonString)

And with swapped key, value:
JObject.Parse(“{”“01"”:““BLANCO””,““02"”:”“NEGRO”“}”).Properties.ToDictionary(Function (x) x.Value.ToString, Function (x) x.Name)

Muchas gracias, el problema era un salto de línea que había en el texto almacenado en la variable. Estaba aplicando los valores como me propusiste desde un principio y me daba un resultado null, el problema era el salto de línea que no me aparecía y hasta que no reemplazé los saltos de línea no se resolvió.

@albertomachuca
Perfect so a line break (salto de línea) did some bad, but finally it was working. Once the final test was ok may we ask you to close the topic by marking the solving post as solution.
grafik
Thanks

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.