0
Its saying basically that they are all not equal to b
static void Main(string[] args) { string itemsInBoxs; string whatYouWant; itemsInBoxs = Console.ReadLine(); whatYouWant = Console.ReadLine(); Console.Write(HowLongItGonnaTake(itemsInBoxs ,whatYouWant) * 5); } static int HowLongItGonnaTake(string a, string b) { int count = 1; foreach (string word in a.Split(",")) { if(b != word) { count ++; } } return count; }
3 Respuestas
0
I was able to do an else then break the loop and it worked
+ 1
Jakub Quinn
You cannot compare String like that.
a != b //wrong
!a.Equals(b) //right
0
This for the safety deposit box challenge on meduim