[#bsl-basic_string-0e-rfind-0f]
= xref:bsl.adoc[bsl]::xref:bsl/basic_string-0e.adoc[basic&lowbar;string&lt;wchar&lowbar;t&gt;]::rfind
:relfileprefix: ../../
:mrdocs:

`rfind` overloads

== Synopses

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

Return the position of the _last_ occurrence of the specified `character`, if such an occurrence can be found in this string (on or _before_ 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-0e/size_type.adoc[size&lowbar;type]
xref:bsl/basic_string-0e/rfind-00.adoc[rfind](
    wchar&lowbar;t character,
    xref:bsl/basic_string-0e/size_type.adoc[size&lowbar;type] position = npos) const;
----

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

Return the starting position of the _last_ occurrence of the specified `substring` within this string, if such a sequence can be found in this string (on or _before_ the optionally specified `position` if such a `position` is specified) using `CHAR&lowbar;TRAITS&colon;&colon;eq` to compare characters, and return `npos` otherwise&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:bsl/basic_string-0e/size_type.adoc[size&lowbar;type]
xref:bsl/basic_string-0e/rfind-031.adoc[rfind](
    xref:bsl/basic_string-0faf.adoc[basic&lowbar;string&lt;wchar&lowbar;t&gt;] const& substring,
    xref:bsl/basic_string-0e/size_type.adoc[size&lowbar;type] position = npos) const noexcept;
----

[.small]#xref:bsl/basic_string-0e/rfind-031.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-0e/size_type.adoc[size&lowbar;type]
xref:bsl/basic_string-0e/rfind-03a.adoc[rfind](
    wchar&lowbar;t const* characterString,
    xref:bsl/basic_string-0e/size_type.adoc[size&lowbar;type] position = npos) const;
----

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

Return the starting position of the _last_ occurrence of the specified `substring` within this string, if such a sequence can be found in this string (on or _before_ the optionally specified `position` if such a `position` is specified) using `CHAR&lowbar;TRAITS&colon;&colon;eq` to compare characters, 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-0e/size_type.adoc[size&lowbar;type]
xref:bsl/basic_string-0e/rfind-08.adoc[rfind](
    STRING&lowbar;VIEW&lowbar;LIKE&lowbar;TYPE const& substring,
    xref:bsl/basic_string-0e/size_type.adoc[size&lowbar;type] position = npos) const noexcept(true);
----

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

Return the starting position of the _last_ occurrence of a substring whose value equals that of the specified `characterString` of the optionally specified `numChars` length, if such a substring can be found in this string (on or _before_ 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-0e/size_type.adoc[size&lowbar;type]
xref:bsl/basic_string-0e/rfind-06.adoc[rfind](
    wchar&lowbar;t const* characterString,
    xref:bsl/basic_string-0e/size_type.adoc[size&lowbar;type] position,
    xref:bsl/basic_string-0e/size_type.adoc[size&lowbar;type] numChars) const;
----

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


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