A string with any message. Then, determine if the message contains the string, "hello".
string message = Console.ReadLine(); // Initializing a string with user input
if (message.Contains("hello"))
{
Console.WriteLine("Message contains string \"hello\"");
}
else
{
Console.WriteLine("Message doesn't contain string \"hello\"");
}
Comments
Leave a comment