[
{
"address":"addr1qx8trv7wualsnpj7xt"
},
{
"address":"addr1qxkyl8vvmvy92ngm0y"
},
{
"address":"addr1qywshwl6ud2myc0k2z"
}
]
The above is a JSON file I'm trying to deserialize and read via NewtonsoftJSON.
However, I get the following error
'Unexpected character encountered while parsing value: {. Path '', line 1, position 2.'
What am I doing wrong? All I want to do is parse all addresses and put them in a list.
Full Code:
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
namespace TestJSON
{
class Program
{
static void Main(string[] args)
{
string json = @"[{""address"":""addr1qx8trv7wualsnpj7xt""}, {""address"":""addr1qxkyl8vvmvy92ngm0y""}, {""address"":""addr1qywshwl6ud2myc0k2z""}]";
List<string> addresses = JsonConvert.DeserializeObject<List<string>>(json);
foreach (string address in addresses)
{
Console.WriteLine(address);
}
Console.WriteLine(addresses);
}
}
}