954,499 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Check for double lines

I have a program that accepts multiple lines of strings for a variable and accepts another set of multiple strings for the next set of variables, and so on, each seperated by a free line i.e.\n\n

How do I write such a program?

imolorhe
Junior Poster in Training
55 posts since Nov 2009
Reputation Points: 4
Solved Threads: 2
 

Are they std::strings? You can use the string's find method ( http://www.cplusplus.com/reference/string/string/find/ ) to locate the string "\n\n" (using multiple calls to it, noting the position at which you last found it as the beginning of the next search).

jonsca
Quantitative Phrenologist
Team Colleague
5,621 posts since Sep 2009
Reputation Points: 1,165
Solved Threads: 581
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: