You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Yi Zhang edited this page May 28, 2018
·
3 revisions
Namespace: FormatterClassLibrary
Description: Format expressions represented as string to human-readable format.
Parameters
Description
expression<string>
expression to be formatted, represented as string
Returns
Description
string
formatted expression
Exceptions
Cause
NullReferenceException
expression is null
ArgumentException
expression is not a valid math expression
Examples:
varunarys=newHashSet<string>(){"fact","sin","log"};varformatter=newExpressionFormatter(unarys);Console.WriteLine(formatter.Format("8 % 4"));//8 % 4 since there is no unary operatorConsole.WriteLine(formatter.Format("8 % 4 fact"));//8 % fact(4)Console.WriteLine(formatter.Format("8 + 4 fact sin log"));//8 + log(sin(fact(4)))