If(readresult) not working?
It's looping in the prompt to write the user, only works with "exit" (while (menuSelection != "exit");)
3 Replies
Console.ReadLine()
is null only in some specific edge cases
Did you perhaps want to see if it's empty?Did you perhaps want to use
string.IsNullOrEmpty
instead?
or maybe even string.IsNullOrWhitespace
also, its usually recommended to "invert" those if-statements
instead of checking "hey is this value valid, then lets go on" you check "hey is this value INVALID, then we stop"
it stops your code from becoming a pyramid of indentionsYour switch case is useless
First you are checking if menuSelection is "1", then you have a switch case checking if it is "human"