Delphi parse JSON array or array

前端 未结 3 572
臣服心动
臣服心动 2021-01-12 17:26

This is the sample JSON I want to be able to parse:

[
  {
    \"a\":{
      \"username\":\"aaa\",
      \"email\":\"         


        
3条回答
  •  有刺的猬
    2021-01-12 18:06

    if you use Alcinoe TalJsonDocument it's will be simple as this :

    aJsonDoc := TalJsonDocU.create;
    aJsonDoc.loadFromFile(...);
    for i := 0 to aJsonDoc.node.childnodes.count-1 do begin
      myValue := aJsonDoc.node.childNodes[i].getchildNodeValueText(['b', 'email']); 
      if myValue <> '' then break;
    end;
    

提交回复
热议问题