0

I can successfully parse the specific JSON data from a JSON file. The issue is that the file I am parsing is inconsistant with the letter case. So I need to do a case insensitive match instead of the default case sensitive match. I Google search this and it appears to be possible, but none of the examples are for jsonNode.Parse. Here is my code so far.

Using reader As New StreamReader(ext_manifest)
    Do Until reader.EndOfStream
        node_data = reader.ReadToEnd
    Loop
End Using

           
Dim node As JsonNode = JsonNode.Parse(node_data)
first_name = node("name").ToString
msgbox(first_name)

This gets results as long as the word casing I specify matches the one in the file. However, the word case seems to inconsistant in the file itself

2
  • usually this matches sense if you are binding to an object, but it doesnt look like you are binding to any object, so not sure how this makes sense or what you are matching or not matching against given you are using a generic object Commented Jan 10 at 23:49
  • I just want to get the value the "name" key and for it to not matter if the name key in the JSON file is in caps, mixed or in lower case. Commented Jan 11 at 2:10

1 Answer 1

0

I just converted jsonNode result to lower case and now it does not matter what case the key name is in.

Using reader As New StreamReader(ext_manifest)
    Do Until reader.EndOfStream
        node_data = reader.ReadToEnd
    Loop
End Using

       
Dim node As JsonNode = JsonNode.Parse(node_data.tolower)
first_name = node("name").ToString
msgbox(first_name)
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.