Communities for your favorite technologies. Explore all Collectives
Ask questions, find answers and collaborate at work with Stack Overflow for Teams.
Ask questions, find answers and collaborate at work with Stack Overflow for Teams. Explore Teams
Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
I have this json object that looks like this below but I can't figure out how to acccess the objects data
I want to access the 5th index like this
jsonContent[5] error CS0021: Cannot apply indexing with [] to an expression of type 'object'
quotes
jsonContent
jsonContent["quotes"]
It looks like an object rather than array. So try jsonContent["5"] or jsonContent["[5]"] instead ?
Add a comment
Here is what is needed, using the JObject library.
var currency = (jsonContent["quotes"] as JObject)["USD"].Value<decimal>();
Start asking to get answers
Find the answer to your question by asking.
Explore related questions
See similar questions with these tags.
quotesis not returning a list of quotes ;)jsonContentis not an array but it is an object.jsonContent["quotes"].