Search code examples
c#arrayswebmethod

Cannot convert Array to String


I am using the following WebMethod-

[WebMethod]
    public string get_IDs(string uid)
    {


        string url = "www.foobar.com/id=-1&user_id=" + uid";

        String data = SearchData(url);

        JObject o = JObject.Parse(data);

        string ids = (string)o["ids"];


        return ids;
    }

My problem being the data returned is in array form, I want it back as a string however this throws up the exception that cannont convert array to string. How can I do this?


Solution

  • I sorted it -

    string followers = (string)o["ids"].ToString();