exercism/csharp/bob/Bob.cs

16 lines
380 B
C#
Raw Normal View History

2016-08-23 17:33:06 +00:00
internal class Bob {
public static string Hey(string inp) {
inp = inp.Trim();
if(inp == "") {
return "Fine. Be that way!";
}
if(inp == inp.ToUpper() && inp != inp.ToLower()) {
return "Whoa, chill out!";
}
if(inp[inp.Length-1] == '?') {
return "Sure.";
}
return "Whatever.";
}
}