我有一个tweeter json(保存在一个名为latest.json的文件中),我解析为"jasonvalue doc",我尝试读取它并打印特定数据.下面的代码每次打印相同的数据,而不是数据形成整个json.
auto content = to!string(read("latest.json"));
JSONValue doc = parseJSON(content).object;
while (i<3){
writeln(doc.object["created_at"].str,"\n");
writeln(doc.object["text"].str,"\n");
writeln(doc.object["retweet_count"].integer,"\n");
i++;
}
Run Code Online (Sandbox Code Playgroud)
我怎么能读到所有的杰森?