Skip to content

OperatorConverter.IsBinary(string)

Yi Zhang edited this page May 29, 2018 · 1 revision

Namespace: ConverterClassLibrary

Description: Checks if an operator is a binary operator.

Parameters Description
token<string> input to be examined
Returns Description
bool true when token is a binary operator

Examples:

string[] operators = { "+", "-", "!" };
var unarys = new HashSet<string>() { "!" };
var converter = new OperatorConverter(operators, unarys);

Console.WriteLine(converter.IsBinary("+")); //true
Console.WriteLine(converter.IsBinary("-")); //true
Console.WriteLine(converter.IsBinary("!")); //false

Clone this wiki locally