Answer the question
In order to leave comments, you need to log in
How to store the result of a function in an array?
Hi all.
There is a method that works with api.vk and returns the result as strings.
From them, I need to pull out certain values.
How can you assign the result of a method that returns a string type to the string[] array, so that you can then iterate through it using for.
Here's what I want to get:
link= GetWall(); // Вот тут вылетает ошибка Error 1 Cannot implicitly convert type 'string' to 'string[]'
link.Substrings("date:", ",", 0);
for (int i = 0; i < link.Length; i++)
{
MessageBox.Show(link[i]);
}
Answer the question
In order to leave comments, you need to log in
Did not work with api.vk, but it probably returns data as a string, which is JSON. Use any of the prebuilt libraries to deserialize JSON data.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question