From 2e879a105d0ea89823c245a952556b1585bb7c1b Mon Sep 17 00:00:00 2001 From: Jidong Xiao Date: Fri, 3 Nov 2023 00:22:24 -0400 Subject: [PATCH] adding the two string function notes --- hws/08_youtube_comments/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hws/08_youtube_comments/README.md b/hws/08_youtube_comments/README.md index 1f7f598..c453b17 100644 --- a/hws/08_youtube_comments/README.md +++ b/hws/08_youtube_comments/README.md @@ -227,7 +227,7 @@ In this assignment, we define that a child comment should be indented by four sp jsonFile.close(); ``` -After these lines, the whole content of the json file will be stored as a string in the std::string variable *json_content*. And you can then parse it to get each individual comment. In order to parse the *json_content*, which is a std::string, you will once again find that the std::string functions such as *std::string::find*(), and *std::string**substr*() to be very useful. +After these lines, the whole content of the json file will be stored as a string in the std::string variable *json_content*. And you can then parse it to get each individual comment. In order to parse the *json_content*, which is a std::string, you will once again find that the std::string functions such as *std::string::find*(), and *std::string::substr*() to be very useful. 2. **The second input file** contains comments, which may have spaces, and that makes it hard for you to use the >> operator to read the content of the file. Once again, the *getline* function can come into play. Let's say you want to read a line like this: