[#bsl-basic_string-0faf-find_first_of-0c]
= xref:bsl.adoc[bsl]::xref:bsl/basic_string-0faf.adoc[basic&lowbar;string]::find&lowbar;first&lowbar;of
:relfileprefix: ../../
:mrdocs:

`find&lowbar;first&lowbar;of` overloads

== Synopses

Declared in `&lt;bslstl&lowbar;string&period;h&gt;`

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&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:bsl/basic_string-0faf/size_type.adoc[size&lowbar;type]
xref:bsl/basic_string-0faf/find_first_of-052.adoc[find&lowbar;first&lowbar;of](
    CHAR&lowbar;TYPE character,
    xref:bsl/basic_string-0faf/size_type.adoc[size&lowbar;type] position = 0) const;
----

[.small]#xref:bsl/basic_string-0faf/find_first_of-052.adoc[_» more&period;&period;&period;_]#

Return the position of the _first_ occurrence of a character belonging to the specified `characterString`, 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&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:bsl/basic_string-0faf/size_type.adoc[size&lowbar;type]
xref:bsl/basic_string-0faf/find_first_of-01.adoc[find&lowbar;first&lowbar;of](
    xref:bsl/basic_string-0faf.adoc[basic&lowbar;string] const& characterString,
    xref:bsl/basic_string-0faf/size_type.adoc[size&lowbar;type] position = 0) const noexcept;
----

[.small]#xref:bsl/basic_string-0faf/find_first_of-01.adoc[_» more&period;&period;&period;_]#

Same as the preceding `find&lowbar;first&lowbar;of` overload, searching from the start of the string&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:bsl/basic_string-0faf/size_type.adoc[size&lowbar;type]
xref:bsl/basic_string-0faf/find_first_of-05a.adoc[find&lowbar;first&lowbar;of](
    CHAR&lowbar;TYPE const* characterString,
    xref:bsl/basic_string-0faf/size_type.adoc[size&lowbar;type] position = 0) const;
----

[.small]#xref:bsl/basic_string-0faf/find_first_of-05a.adoc[_» more&period;&period;&period;_]#

Return the position of the _first_ occurrence of a character belonging to the specified `characterString`, 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&period; The behavior is undefined unless the conversion from `STRING&lowbar;VIEW&lowbar;LIKE&lowbar;TYPE` to `bsl&colon;&colon;basic&lowbar;string&lowbar;view&lt;CHAR&lowbar;TYPE, CHAR&lowbar;TRAITS&gt;` does not throw any exception&period; Note that this behavior differs from the behavior implemented in the standard container, where the following noexcept specification is used&colon; &grave; noexcept( std&colon;&colon;is&lowbar;nothrow&lowbar;convertible&lowbar;v&lt;const T&amp;, std&colon;&colon;basic&lowbar;string&lowbar;view&lt;CharT, Traits&gt; &gt;) &grave;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class STRING&lowbar;VIEW&lowbar;LIKE&lowbar;TYPE&gt;
xref:bsl/basic_string-0faf/size_type.adoc[size&lowbar;type]
xref:bsl/basic_string-0faf/find_first_of-0a.adoc[find&lowbar;first&lowbar;of](
    STRING&lowbar;VIEW&lowbar;LIKE&lowbar;TYPE const& characterString,
    xref:bsl/basic_string-0faf/size_type.adoc[size&lowbar;type] position = 0) const noexcept(true);
----

[.small]#xref:bsl/basic_string-0faf/find_first_of-0a.adoc[_» more&period;&period;&period;_]#

Return the position of the _first_ occurrence of a character belonging to the specified `characterString` of the optionally specified `numChars` length, 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&period; If `numChars` is not specified, `CHAR&lowbar;TRAITS&colon;&colon;length(characterString)` is used&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:bsl/basic_string-0faf/size_type.adoc[size&lowbar;type]
xref:bsl/basic_string-0faf/find_first_of-055.adoc[find&lowbar;first&lowbar;of](
    CHAR&lowbar;TYPE const* characterString,
    xref:bsl/basic_string-0faf/size_type.adoc[size&lowbar;type] position,
    xref:bsl/basic_string-0faf/size_type.adoc[size&lowbar;type] numChars) const;
----

[.small]#xref:bsl/basic_string-0faf/find_first_of-055.adoc[_» more&period;&period;&period;_]#


[.small]#Created with https://www.mrdocs.com[MrDocs]#
