AngouriMath
expression from string
There are a few ways to parse an expression from string. ## With FromString
using AngouriMath;
var expr = MathS.FromString("1 + 1");
It will throw an exception if input is bad.
## With implicit cast
using AngouriMath;
Entity expr = "1 + 1";
It will also throw an exception in case of bad input.
## With method Parse
Unlike others, this one won't throw. However, it returns an object which requries validation:
var expr5 = Parse("a + b").Switch(
res => res,
failure => failure.Reason.Switch
Angouri © 2019-2023 · Project's repo · Site's repo · Octicons · Transparency · 1534 pages online