[#bsl-basic_string-0faf-find-0b5] = xref:bsl.adoc[bsl]::xref:bsl/basic_string-0faf.adoc[basic_string]::find :relfileprefix: ../../ :mrdocs: Find the first occurrence of a sequence in this string. == Synopsis Declared in `<bslstl_string.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:bsl/basic_string-0faf/size_type.adoc[size_type] find( CHAR_TYPE const* substring, xref:bsl/basic_string-0faf/size_type.adoc[size_type] position, xref:bsl/basic_string-0faf/size_type.adoc[size_type] numChars) const; ---- == Description 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. == Return Value position of the match, or `npos` if not found == Parameters [cols="1,4"] |=== | Name| Description | *substring* | substring to search for | *position* | starting index | *numChars* | number of characters |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#