On Monday, 13 April 2020 at 02:20:39 UTC, Adnan wrote:
Now in the above inner loop getStr(node["com"].str()) crashes in runtime if an array does not contain "com" node. I want to avoid that. How should I proceed?
Try: if("com" in node) { }
Adam D. Ruppe via Digitalmars-d-learn Sun, 12 Apr 2020 19:25:45 -0700
On Monday, 13 April 2020 at 02:20:39 UTC, Adnan wrote:
Now in the above inner loop getStr(node["com"].str()) crashes in runtime if an array does not contain "com" node. I want to avoid that. How should I proceed?
Try: if("com" in node) { }