Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9075403
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T18:51:13+00:00 2026-06-16T18:51:13+00:00

How is it possible to let user enter more paragraphs before enter or carriage

  • 0

How is it possible to let user enter more paragraphs before enter or carriage return is supplied?

Knowing that after each paragraph one should hit enter to mark that he finished that paragraph.

I have to count this paragraphs. In the case that the text is read from a file, maybe that would be ok (I still don’t know for sure what delimiting character I am looking for for counting paragraphs).

But when you read text inputs by a user from the keyboard, how can I count paragraphs – no idea.

Let’s say user starts and input some statements and then hits enter… program finished… 1 paragraph and that’s it.

How can I allow the user to input 2 paragraphs or more and count them?

I’d probably prefer simple “beginner” method instead of regex… I can count sentences but not under any way paragraphs inputs from keyboard… probably wants to be a loop or something to allow user to input more then one paragraphs and than what user does when he finished inputs of paragraphs? hits enter again… so confusion, confusion, confusion..

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T18:51:14+00:00Added an answer on June 16, 2026 at 6:51 pm

    How about this:

    List<string> lines = new List<string>();
    string line = Console.ReadLine();
    while(!string.IsNullOrEmpty(line))
    {
        lines.Add(line);
        line = Console.ReadLine();
    }
    

    Then lines will contain all of the paragraphs that the user entered, and they can indicate the end of their entry by hitting Enter without entering anything.

    EDIT: If you only need to count how many paragraphs the user entered (not store them), then this would work:

    int paragraphsEntered = 0;
    string line = Console.ReadLine();
    while(!string.IsNullOrEmpty(line))
    {
        paragraphsEntered++
        line = Console.ReadLine();
    }
    Console.WriteLine("You entered {0} paragraph(s).", paragraphsEntered);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Let's say I have a user enter the URL of an image. After URL
Is it possible to let user enters a path with quotes in JFileChooser and
Is it possible to let your user download a file with a different name?
Possible Duplicate: Regular Expressions: Is there an AND operator? I let my users enter
I want to let a user of a web app enter a URL and
Is it possible to show a dialog box to let the user select a
Possible Duplicate: Dynamic source code in C++ is it possible to let the user
I want to let the user enter some names in a UITextField (preferably seperated
(How) is it possible to let the user store a file (via save file
I was thinking about creating a Web app that would let people enter text

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.