[#bsl-basic_string-0ce-find-00] = xref:bsl.adoc[bsl]::xref:bsl/basic_string-0ce.adoc[basic_string<char16_t>]::find :relfileprefix: ../../ :mrdocs: `find` overloads == Synopses Declared in `<bslstl_string.h>` Return the position of the _first_ occurrence of the specified `character`, if such an occurrence can be found in this string (on or _after_ the optionally specified `position` if such a `position` is specified), and return `npos` otherwise. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:bsl/basic_string-0ce/size_type.adoc[size_type] xref:bsl/basic_string-0ce/find-0b.adoc[find]( char16_t character, xref:bsl/basic_string-0ce/size_type.adoc[size_type] position = 0) const; ---- [.small]#xref:bsl/basic_string-0ce/find-0b.adoc[_» more..._]# Return the starting position of the _first_ occurrence of the specified `substring`, 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. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:bsl/basic_string-0ce/size_type.adoc[size_type] xref:bsl/basic_string-0ce/find-02.adoc[find]( xref:bsl/basic_string-0faf.adoc[basic_string<char16_t>] const& substring, xref:bsl/basic_string-0ce/size_type.adoc[size_type] position = 0) const noexcept; ---- [.small]#xref:bsl/basic_string-0ce/find-02.adoc[_» more..._]# Same as the three‐argument `find` overload with `position` 0. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:bsl/basic_string-0ce/size_type.adoc[size_type] xref:bsl/basic_string-0ce/find-0a.adoc[find]( char16_t const* substring, xref:bsl/basic_string-0ce/size_type.adoc[size_type] position = 0) const; ---- [.small]#xref:bsl/basic_string-0ce/find-0a.adoc[_» more..._]# Return the starting position of the _first_ occurrence of the specified `substring`, 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. The behavior is undefined unless the conversion from `STRING_VIEW_LIKE_TYPE` to `bsl::basic_string_view<CHAR_TYPE, CHAR_TRAITS>` does not throw any exception. Note that this behavior differs from the behavior implemented in the standard container, where the following noexcept specification is used: ` noexcept( std::is_nothrow_convertible_v<const T&, std::basic_string_view<CharT, Traits> >) ` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class STRING_VIEW_LIKE_TYPE> xref:bsl/basic_string-0ce/size_type.adoc[size_type] xref:bsl/basic_string-0ce/find-03.adoc[find]( STRING_VIEW_LIKE_TYPE const& substring, xref:bsl/basic_string-0ce/size_type.adoc[size_type] position = 0) const noexcept(true); ---- [.small]#xref:bsl/basic_string-0ce/find-03.adoc[_» more..._]# 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. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:bsl/basic_string-0ce/size_type.adoc[size_type] xref:bsl/basic_string-0ce/find-0f.adoc[find]( char16_t const* substring, xref:bsl/basic_string-0ce/size_type.adoc[size_type] position, xref:bsl/basic_string-0ce/size_type.adoc[size_type] numChars) const; ---- [.small]#xref:bsl/basic_string-0ce/find-0f.adoc[_» more..._]# [.small]#Created with https://www.mrdocs.com[MrDocs]#