Case-Insensitive Searching
Now we're ready to discuss the first regular member function in the xstring class: find_nocase. We need this function to determine whether a given xstring contains a particular sequence of characters. For example, if we have an xstring containing the value “red, blue, and green”, describing the colors of a sofa, we want to be able to determine whether the letters “b”, “l”, “u”, and “e” appear consecutively in that string. If they do, it is sometimes also useful to know where that sequence of characters starts in the xstring.
Susan wanted to know why we would need to know where a sequence of characters was found in a string:
Susan: I understand why we need to know if we can find some characters in a string, but why would ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access