- Home /
How to get keyvalue from MiniJSON unity
I have url values in JSON format and i used MiniJson to parse the values from JSON url and i'm getting the values but i'm getting the url value is " modellinksArray: {0} ", modellinksArray["link"]"
foreach (IDictionary modellinksArray in linksObject) {
String modal3d=string.Format("modellinksArray: {0} ", modellinksArray["link"]);
Debug.Log("modal Url load is "+ modal3d);
Log:
modellinksArray: http://server.com/Unity/3dmodel/cat/cat.obj
Here i'm getting modellinksArray: before the url. How can i extract only url from modellinksArray?
Answer by Baste · Nov 18, 2014 at 11:46 AM
You put the 'modellinksArray:' there yourself:
String modal3d=string.Format("modellinksArray: {0} ", modellinksArray["link"]);
The Format call adds the text to the string. In fact, the string.Format call does exactly the same thing right now as:
String model3d = "modellinksArray: " + modellinksArray["link"] + " ";
Just ditch the Formatting call and grab modellinksArray["link"] directly if that's the url you're looking for.
Your answer
Follow this Question
Related Questions
Cannot cast from source type to destination type Json 0 Answers
minijson pars 0 Answers
How do I use WWWform and JSON to login to reddit? 1 Answer
What is the easiest json library to integrate with Unity? 12 Answers
JSON vs XML for Unity C# 1 Answer