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..
How about this:
Then
lineswill 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: