Find the first occurrence of a sequence in this string.
Declared in <bslstl_string.h>
size_type
find(
CHAR_TYPE const* substring,
size_type position,
size_type numChars) const;
Return the starting position of the first occurrence of the specified substring of the optionally specified numChars length, if such a substring can be found in this string (on or after the optionally specified position if such a position is specified) using CHAR_TRAITS::eq to compare characters, and return npos otherwise. If numChars is not specified, CHAR_TRAITS::length(substring) is used.
position of the match, or npos if not found
| Name | Description |
|---|---|
| substring | substring to search for |
| position | starting index |
| numChars | number of characters |