A
A
Arseniy Sokolovsky2021-11-20 17:55:37
C++ / C#
Arseniy Sokolovsky, 2021-11-20 17:55:37

How to convert array to List in Unity?

There is a GET request that returns an array:
unknown.png
I need to find out its length, but Length returned 156
unknown.png
I thought that if I need to know the normal length, then I need to use Count, it's still an array, how can I convert it to List<> and find out the correct one length?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vasily Bannikov, 2021-11-20
@SokolarGm

Well, firstly, apparently, there is not just an array, but a string with a json array inside.
By that .Length return the number of characters.
It needs to be deserialized first.
https://docs.unity3d.com/ScriptReference/JsonUtili...
Then you can find out the real size of the array in elements.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question