excel - How do I preserve spaces in retrieving json keys? -
i using vba-json parse json , having trouble preserving spaces in keys. new vba , didn't see in class give me option preserve spaces in keys. using class found here
i have:
function me_() dim s, json, s = "{'key one':'value one','key two':'value two'}" dim lib new jsonlib set json = lib.parse(cstr(s)) each in json debug.print & "," & json.item(i) next me_ = "done" end function this preserves spaces in values not keys:
keyone,value 1 keytwo,value 2 (jsonlint.com says json valid spaces in keys)
it's easy, fix yourself, find method parsekey.
whitespaces (spaces, tabs , different linebreaks) ignored in keys on line 282:
if instr(vbcrlf & vbcr & vblf & vbtab & " ", char)
Comments
Post a Comment