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

`find` overloads

== Synopses

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

Find the first occurrence of a character in this 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-0a.adoc[find](
    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-0a.adoc[_» more&period;&period;&period;_]#

Find the first occurrence of a sequence in this 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-0bd.adoc[find](
    xref:bsl/basic_string-0faf.adoc[basic&lowbar;string] const& substring,
    xref:bsl/basic_string-0faf/size_type.adoc[size&lowbar;type] position = 0) const noexcept;
----

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

Same as the three&hyphen;argument `find` overload with `position` 0&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-0c1.adoc[find](
    CHAR&lowbar;TYPE const* substring,
    xref:bsl/basic_string-0faf/size_type.adoc[size&lowbar;type] position = 0) const;
----

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

Find the first occurrence of a sequence in this string&period;


[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-0e.adoc[find](
    STRING&lowbar;VIEW&lowbar;LIKE&lowbar;TYPE const& substring,
    xref:bsl/basic_string-0faf/size_type.adoc[size&lowbar;type] position = 0) const noexcept(true);
----

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

Find the first occurrence of a sequence in this 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-0b5.adoc[find](
    CHAR&lowbar;TYPE const* substring,
    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-0b5.adoc[_» more&period;&period;&period;_]#

== Return Value

position of the match, or `npos` if not found

== Parameters

[cols="1,4"]
|===
| Name| Description
| *character*
| character to search for
| *position*
| index at which to start the search
| *substring*
| substring to search for
| *numChars*
| number of characters
|===


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