list.indexof not working

    public List<char> list = new List<char>();
    void Start()
{
   int v = list.IndexOf(+);
}

gives error "Invalid expression ‘)’;

You have to wrap the character in single quotes to indicate that it’s a char:

int v = list.IndexOf('+');
1 Like

thanks