Skip to content

jasiukiewicztymon/JSON.cs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 

Repository files navigation

json cs

Examples

Console.WriteLine(JSON.Parser.parse("[{  \"id\": 1,  \"first_name\": \"Jeanette\",  \"last_name\": \"Penddreth\",  \"email\": \"[email protected]\",  \"gender\": \"Female\",  \"ip_address\": \"26.58.193.2\"}, {  \"id\": 2,  \"first_name\": \"Giavani\",  \"last_name\": \"Frediani\",  \"email\": \"[email protected]\",  \"gender\": \"Male\",  \"ip_address\": \"229.179.4.212\"}, {  \"id\": 3,  \"first_name\": \"Noell\",  \"last_name\": \"Bea\",  \"email\": \"[email protected]\",  \"gender\": \"Female\",  \"ip_address\": \"180.66.162.255\"}, {  \"id\": 4,  \"first_name\": \"Willard\",  \"last_name\": \"Valek\",  \"email\": \"[email protected]\",  \"gender\": \"Male\",  \"ip_address\": \"67.76.188.26\"}]").get(1).get("ip_address").get_string());
$ - 229.179.4.212
JSON.JSON test = JSON.Parser.parse("  [  {   \t\"id\": 1,  \"first_name\": \"Jeanette\",   \"last_name\": \"Penddreth\",  \"email\": \"[email protected]\",  \"gender\": \"Female\",  \"ip_address\": \"26.58.193.2\"}, {  \"id\": 2,  \"first_name\": \"Giavani\",  \"last_name\": \"Frediani\",  \"email\": \"[email protected]\",  \"gender\": \"Male\",  \"ip_address\": \"229.179.4.212\"}, {  \"id\": 3,  \"first_name\": \"Noell\",  \"last_name\": \"Bea\",  \"email\": \"[email protected]\",  \"gender\": \"Female\",  \"ip_address\": \"180.66.162.255\"}, {  \"id\": 4,  \"first_name\": \"Willard\",  \"last_name\": \"Valek\",  \"email\": \"[email protected]\",  \"gender\": \"Male\",  \"ip_address\": \"67.76.188.26\"}  ]  ");
Console.WriteLine(test.ToString());
$ - [{"id":1,"first_name":"Jeanette","last_name":"Penddreth","email":"[email protected]","gender":"Female","ip_address":"26.58.193.2"},{"id":2,"first_name":"Giavani","last_name":"Frediani","email":"[email protected]","gender":"Male","ip_address":"229.179.4.212"},{"id":3,"first_name":"Noell","last_name":"Bea","email":"[email protected]","gender":"Female","ip_address":"180.66.162.255"},{"id":4,"first_name":"Willard","last_name":"Valek","email":"[email protected]","gender":"Male","ip_address":"67.76.188.26"}]

To-do

  • Better string formatting with \
  • JSON class from file
  • , token error in Objects and Arrays
  • JSON class to JSON string