Skip to content
Discussion options

You must be logged in to vote
var engine = new Engine();
const string Json = """{ "invoice": { "id": "inv123" } }""";
engine.SetValue("jsonString", Json);
var id = engine.Evaluate("const obj = JSON.parse(jsonString); obj.invoice.id;").AsString();
Assert.Equal("inv123", id);

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@rajasekarshanmugam
Comment options

@lahma
Comment options

lahma Dec 13, 2022
Collaborator

@rajasekarshanmugam
Comment options

@lahma
Comment options

lahma Dec 13, 2022
Collaborator

Answer selected by rajasekarshanmugam
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #1376 on December 12, 2022 13:07.