Skip to content

Instantly share code, notes, and snippets.

@JoshVarty
Created October 16, 2015 00:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JoshVarty/997e84603c3562351591 to your computer and use it in GitHub Desktop.
Save JoshVarty/997e84603c3562351591 to your computer and use it in GitHub Desktop.
var result = await CSharpScript.EvaluateAsync("5 + 5");
Console.WriteLine(result); // 10
result = await CSharpScript.EvaluateAsync(@"""sample""");
Console.WriteLine(result); // sample
result = await CSharpScript.EvaluateAsync(@"""sample"" + "" string""");
Console.WriteLine(result); // sample string
result = await CSharpScript.EvaluateAsync("int x = 5; int y = 5; x"); //Note the last x is not contained in a proper statement
Console.WriteLine(result); // 5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment