[#absl-ClippedSubstr] = xref:absl.adoc[absl]::ClippedSubstr :relfileprefix: ../ :mrdocs: Like `s.substr(pos, n)`, but clips `pos` to an upper bound of `s.size()`. == Synopsis Declared in `<absl/strings/string_view.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- std::string_view ClippedSubstr( std::string_view s, size_t pos, size_t n = string_view::npos); ---- == Description Provided because std::string_view::substr throws if `pos > size()`. == Return Value A view of the clipped substring. == Parameters [cols="1,4"] |=== | Name| Description | *s* | The string view to take a substring of. | *pos* | The starting position, clipped to `s.size()`. | *n* | The number of characters to include in the substring. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#