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

`rfind` overloads

== Synopses

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

Find the last 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/rfind-011.adoc[rfind](
    CHAR&lowbar;TYPE character,
    xref:bsl/basic_string-0faf/size_type.adoc[size&lowbar;type] position = npos) const;
----

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

Return the last occurrence of the specified `substring` 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/rfind-0d6.adoc[rfind](
    xref:bsl/basic_string-0faf.adoc[basic&lowbar;string] const& substring,
    xref:bsl/basic_string-0faf/size_type.adoc[size&lowbar;type] position = npos) const noexcept;
----

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

Same as the three&hyphen;argument `rfind` overload with default position&period;


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

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

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

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

Find the last 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/rfind-01a.adoc[rfind](
    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/rfind-01a.adoc[_» more&period;&period;&period;_]#

== Return Value

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

== Parameters

[cols="1,4"]
|===
| Name| Description
| *character*
| character value
| *position*
| starting index
| *substring*
| substring to search for
| *characterString*
| pointer to characters
| *numChars*
| number of characters
|===


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