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

Return a substring of this string as an rvalue&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:bsl/basic_string-0faf.adoc[basic&lowbar;string]
substr(
    xref:bsl/basic_string-0faf/size_type.adoc[size&lowbar;type] position = 0,
    xref:bsl/basic_string-0faf/size_type.adoc[size&lowbar;type] numChars = npos) &amp;&amp;;
----

== Return Value

substring of this string

== Parameters

[cols="1,4"]
|===
| Name| Description
| *position*
| starting index
| *numChars*
| number of characters
|===


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