TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Mngaro Mwazenje
NA
80
13k
Write a program, that reads user input until an empty line
Mar 31 2020 6:09 AM
Write a program, that reads user input until an empty line. For each non-empty string, the program splits the string by spaces and then prints the pieces that contain av, each on a new line.
> navy blue shirt
navy
> Do you have a favourite flavour
have favourite flavour
> was that a cat
>
Tip! Strings have a Contains method, which tells if a string contains another string. It works like this:
string text = "volcanologist";
if (text.Contains("can"))
{
Console.WriteLine("can was found");
}
if (!text.Contains("tin"))
{ Console.WriteLine("tin wasn't found");
}
can was found
tin wasn't found
Reply
Answers (
2
)
reads strings from the user.
my c# calculator only accepts one digit after selecting an o