如何知道JSON数据是否具有VB.net中的密钥?

时间:2018-01-22 13:43:01

标签: vb.net

使用Newtonsoft库知道密钥是否存在于JSON结构中的正确方法是什么?

1 个答案:

答案 0 :(得分:1)

我个人会使用这种检查方法:

map:: (a -> b) -> [a] -> [b]
map f = foldr g []
  where g x fxs = (f x):fxs

count:: [a] -> Int
count = foldl incr 0
  where incr c _ = c + 1

但可能有其他方法可以这样做。这种方式只是尝试获取一个值,如果找不到它,将返回 Dim JArray = Newtonsoft.Json.Linq.JArray.Parse("JSON") If JArray("Key") IsNot Nothing Then End If ,可以检查:)