I am getting "cannot implicitly convert string to char" error. I am trying the following code, how should I specify the cast in the case statement for the <= operator. any help/direction is appreciated. Thanks!
char test1;
    switch(test1)
    {
       case '+':
        //do something
        break;
      case '-' : case '*' : case '<=' :
       //method1
       break
    method 1:
    private void method1(char test2)
    {
      if(test2 == '+' || test2 == '*' || test2.ToString() == "<=")
       {
         token.Add(test2.ToString());
       }
    }
ok, I have a method1 like this:
private void Method1(char test2)
{
  if(test2 == '+' || test2 == '-' || test2 == '/' || test2 == '*')
    {
       //code
       tokens.add(test2);
    }
char test1;
        switch(test1)
        {
           case '+': case '-' : case '*': case '/':
            Method1(test1);
            break;
I am trying to get the tokens if there is an expression like (a+b)*(a-b). tokens is a list of string here. but, what I am also trying to do here is also check for logical operators if they exist in the expression...ex: (a+b)<=5, in this case, I want to check if the next token is <=, if so add it to the list of tokens, the goal is to have one method to handle all the operators(+,-, *,/,<=,>=, ==, !=) and call it in the switch case statement.

test2.ToString()to be equal to "<="? How can one character be equal to two characters?stringeverywhere, instead ofchar