Answer to Question #335377 in C# for mary

Question #335377

A string with any message. Then, determine if the message contains the string, "hello".


1
Expert's answer
2022-04-29T12:46:57-0400
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\"");
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS