问题:
I would like to parse data from JSON which is of type String
.我想解析来自 JSON 类型的数据String
。 I am using Google Gson .我正在使用Google Gson 。
I have:我有:
jsonLine = "
{
"data": {
"translations": [
{
"translatedText": "Hello world"
}
]
}
}
";
and my class is:我的班级是:
public class JsonParsing{
public void parse(String jsonLine) {
// there I would like to get String "Hello world"
}
}
解决方案:
参考一: https://en.stackoom.com/question/N2P7参考二: https://stackoom.com/question/N2P7