0
Is here an error
string word = "slt"; if (word[0]="s") Console.Write("!!!");
3 ответов
+ 1
Hi! This is python or JavaScript?
+ 1
You can find out yourself by running it in the code playground.
Equal signs in a if statement should be a double equal ==
= is for value assignent
== is for comparison
0
TheMasterBee It is customary to identify which language in the question tags. In this case I figured out that it is C#.
The code has a couple of common mistakes:
One is that of using an assignment operator (=) instead of a comparison operator (==).
Another is that of using a string delimiter (double quote - ") on a char type instead of a character delimiter (single quote - ').