如何使用带方括号的 SelectToken?
How to use SelectToken with square brackets?
如果 JToken 的名称包含方括号,我如何获取值或创建 SelectToken? tmpJToken.Value(Of String)("3/32[v]")
或 tmpJToken.SelectToken("3/32[v]")
我必须转义方括号吗?
JSON 看起来像:
["BeginOfEnumerable",
[
{
"Classification": [
"/",
"/Document/"
],
"FieldValues": {
"/0": "8854723",
"/3/32[v]": "1856929"
},
"Key": "urn:key:Document:1856929"
}
],
"EndOfEnumerable"]
Dim result = tmpJToken.SelectToken("$..FieldValues.['/3/32[v]']")
如果 JToken 的名称包含方括号,我如何获取值或创建 SelectToken? tmpJToken.Value(Of String)("3/32[v]")
或 tmpJToken.SelectToken("3/32[v]")
我必须转义方括号吗?
JSON 看起来像:
["BeginOfEnumerable",
[
{
"Classification": [
"/",
"/Document/"
],
"FieldValues": {
"/0": "8854723",
"/3/32[v]": "1856929"
},
"Key": "urn:key:Document:1856929"
}
],
"EndOfEnumerable"]
Dim result = tmpJToken.SelectToken("$..FieldValues.['/3/32[v]']")