Extending the Functionality of strings

The standard string class has been satisfactory for the uses we've made of it so far, but at this point we need some functionality that is not present in that class, namely, the ability to compare and search for portions of strings without regard to the case of the text involved. For example, we want to be able to consider “Steve” and “steve” equal, even though their ASCII code sequences differ. For another example, we want to be able to determine whether the character sequence “red” is present in a string, regardless of whether it is capitalized.

Susan had a question about why we need to do this:

Susan: Why isn't this already in the standard string class? We can't be the only ones who want to do this.

Get C++: A Dialog Programming with the C++ Standard Library now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.