Run Code
|
API
|
Code Wall
|
Users
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
//Json Get Field from Array
//Rextester.Program.Main is the entry point for your code. Don't change it. //Compiler version 4.0.30319.17929 for Microsoft (R) .NET Framework 4.5 //Json Get Field from Array using System; using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; using Newtonsoft.Json.Linq; namespace Rextester { public class Program { public static void Main(string[] args) { JArray obj = JArray.Parse(@" [{ 'Mouse': 'HPQ', 'VideoCard' : 'NVidia' },{ 'Mouse': 'maou2', 'VideoCard' : 'NVidia2' }] "); Console.WriteLine(obj); JToken token = obj.SelectToken("[1].Mouse"); if(token == null) return; Console.WriteLine(token); } } }
run
|
edit
|
history
|
help
0
Please
log in
to post a comment.
Intuit // C# // listing_4.9 (do_while // kupi_slonika
SingleLinkedList c# operations
Boggle
Collatz Conjecture
async example with HttpClient
OOP vs DOD 2
learning1
Testing 002
Square Integer Matrix
rathit
Please log in to post a comment.