❔ CS version of python dictionary
Is there a good alternative to python's dictionaries? As in json "objects".
16 Replies
System.Collections.Generic.Dictionary
how do I use that?
thinker227#5176
REPL Result: Success
Console Output
Compile: 556.128ms | Execution: 32.909ms | React with ❌ to remove this embed.
can i set a
{"x","y"}
to a field using that?wdym?
something like
Ah, yeah. In that case you're gonna have to use
JsonSerializer
.
First you'll have to create a class representing a person which you can deserialize the JSON into, in this case containing a Job
and Age
property.ah
looks like microsoft has a good page on it, thank you for your help!
thinker227#5176
REPL Result: Success
Result: Person
Compile: 567.269ms | Execution: 64.650ms | React with ❌ to remove this embed.
yeah the MS docs are really good
(do i have to close this now or how does it work here?)
Yeah you can close it using
/close
if you want (although idk what cathei is writing)
This would be equivalent syntax in C# (If you don't need to use Json)
ooo fancy, thank you!
Or
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.