Operator ‘==’ cannot be applied to operands of type ‘char’ and ‘string’

后端 未结 5 1839
情深已故
情深已故 2020-12-07 01:40

I’m working on a self directed simple program to practice concepts I’ve learned thus far. My project is related to chess, in this case specifically the board (columns a-h an

5条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-07 02:36

    Looping through the array just to see if an element is contained in it is kind of overkill when an array has a .Contains method. Something like this without the for loop should work:

        if (gridColumns.Contains(cl[0]))
        {
            //TODO
        } 
    

提交回复
热议问题