exercism / cpp

Exercism exercises in C++.
https://exercism.org/tracks/cpp
MIT License
256 stars 207 forks source link

strings: simplify `find` example #673

Closed ErikSchierboom closed 1 year ago

ErikSchierboom commented 1 year ago

The documentation for the strings concept contains a section on the find method. It contains the following example:

std::string new_release{"apple released a new app!"};
new_release.find("app");
// => 0
new_release.find("!");
// => 24

I wonder if perhaps the example string could be shortened for students to more easily see that the index in the second example is correct. I had no issue with "app" having index 0, but ! having index 24 was a bit harder to spot :)