Skip to content

OperatorConverter.IsUnary(string)

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

Namespace: ConverterClassLibrary

Description: Checks if an operator is a unary operator.

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

Examples:

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

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

Clone this wiki locally