{"id":3168,"date":"2020-03-28T06:50:42","date_gmt":"2020-03-28T06:50:42","guid":{"rendered":"https:\/\/raspberry-projects.com\/pi\/?p=3168"},"modified":"2020-04-05T08:30:04","modified_gmt":"2020-04-05T08:30:04","slug":"using-strings-parsing","status":"publish","type":"post","link":"https:\/\/raspberry-projects.com\/pi\/programming-in-c\/strings\/string-class\/using-strings-parsing","title":{"rendered":"Using Strings-Parsing"},"content":{"rendered":"\n<p><\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Parse String Line By Line<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>#include &lt;iostream> \n#include &lt;string> \nusing namespace std; \n\t\n\tstring ResultsText;\n\tstring NextLine;\n \n\tResultsText = ....Your source string you want to parse line by line\n \n\tstringstream ResultsTextStream(ResultsText); \n  \n\twhile (getline(ResultsTextStream, NextLine))\n\t{ \n\t\tstd::cout &lt;&lt; \"Next Line: \" &lt;&lt; NextLine &lt;&lt; std::endl;\n\t}<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">Parse String Splitting By Delimiter Character<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>#include &lt;iostream> \n#include &lt;string> \nusing namespace std; \n\t\n\tstring ResultsText;\n\tstring NextSection;\n \n\tResultsText = ....Your source string you want to parse line by line\n \n\tstringstream ResultsTextStream(ResultsText); \n  \n\twhile (getline(ResultsTextStream, NextSection, ','))\t\t\/\/&lt;&lt;&lt;&lt;Specify the delimiting character (it is removed from the NextSection output\n\t{ \n\t\tstd::cout &lt;&lt; \"Next Section: \" &lt;&lt; NextSection &lt;&lt; std::endl;\n\t}<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Parse String Line By Line Parse String Splitting By Delimiter Character<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[97],"tags":[],"class_list":["post-3168","post","type-post","status-publish","format-standard","hentry","category-string-class"],"_links":{"self":[{"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/posts\/3168","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/comments?post=3168"}],"version-history":[{"count":5,"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/posts\/3168\/revisions"}],"predecessor-version":[{"id":3200,"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/posts\/3168\/revisions\/3200"}],"wp:attachment":[{"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/media?parent=3168"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/categories?post=3168"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/tags?post=3168"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}