TextParser.Parser.IsOperator C# (CSharp) Method

IsOperator() private method

Checks if the given string is an operator.
Optimized
private IsOperator ( string s ) : bool
s string
return bool
        private bool IsOperator(string s)
        {
            for(int i = 0; i < operatorsPriority.Count; i++) {
                if(operators[operatorsPriority[i]].Equals(s)) {
                    // bring in front of the list
                    if(i != 0) {
                        int temp = operatorsPriority[i];
                        operatorsPriority.RemoveAt(i);
                        operatorsPriority.Insert(0, temp);
                    }

                    return true;
                }
            }

            // not found
            return false;
        }