smiley303
smiley303
CC#
Created by smiley303 on 2/6/2023 in #help
✅ Array Problem - the variable "i" here appears to never change?
7 replies
CC#
Created by smiley303 on 1/28/2023 in #help
❔ Comparison in switch statement
I am having trouble understanding this error (12,10): error CS1525: Invalid expression term '=='
// SKU = Stock Keeping Unit
string sku = "01-MN-L";

string[] product = sku.Split('-');

string type = "";
string color = "";
string size = "";

switch (product[0])
{
case == "01":
break;
}
// SKU = Stock Keeping Unit
string sku = "01-MN-L";

string[] product = sku.Split('-');

string type = "";
string color = "";
string size = "";

switch (product[0])
{
case == "01":
break;
}
Is it not valid to compare equality in switch statement, i am having bad brain fog right now.
7 replies