How to parse JSON

来源:互联网 发布:ansys优化设计实例 编辑:程序博客网 时间:2024/05/16 04:36

JSON (JavaScript Object Notation) is a lightweight data-interchange format. It is easy for humans to read and write. It is easy for machines to parse and generate.

Two basic structures:

  • A collection of name/value pairs. This is realized as a dictionary or hash table in other languages.
  • An ordered list of values. This is realized as an array or list in other languages.

Examples:

  • {"first":"hello","second":"world"}
  • {"people":[{"first":"hello","second":"world"},{"first1"""hello1"}]}

A very simple example to show how to parse Json

https://github.com/niuyuzhou/JsonParserDemo

0 0