Ballpark Orders - Split method [Solved]
Can anybody tell me why my index keeps going 0, 1, 2, ... no matter which combination I enter? Does it have anything to do with the Split method I used? The string of orders is entered with spaces only. (Also, if anybody can tell me how to do this with one single (multidim?) array, I'd be grateful.) https://code.sololearn.com/cv48Ea0K7Y9g/?ref=app
You can link your code like this: Go to Code section, click +, select the programming language, insert your code, save. Come back to this thread, click +, Insert Code, sort for My Code Bits, select your code. This way others can test your code and it is much more readable.
When you try to get the index in foods, you actually try to get the index in words. I think what you want to do is: Array.IndexOf(foods, word)
Thank you Lisa. I've added the code :) Also, how on earth did I not notice I was getting an index from the wrong array? Thank you!