[#absl-ClippedSubstr]
= xref:absl.adoc[absl]::ClippedSubstr
:relfileprefix: ../
:mrdocs:

Like `s&period;substr(pos, n)`, but clips `pos` to an upper bound of `s&period;size()`&period;

== Synopsis

Declared in `&lt;absl&sol;strings&sol;string&lowbar;view&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
std::string&lowbar;view
ClippedSubstr(
    std::string&lowbar;view s,
    size&lowbar;t pos,
    size&lowbar;t n = string&lowbar;view&colon;&colon;npos);
----

== Description

Provided because std&colon;&colon;string&lowbar;view&colon;&colon;substr throws if `pos &gt; size()`&period;

== Return Value

A view of the clipped substring&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *s*
| The string view to take a substring of&period;
| *pos*
| The starting position, clipped to `s&period;size()`&period;
| *n*
| The number of characters to include in the substring&period;
|===


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