std::experi...iew::substr(3)
π NAME π
std::experimental::basic_string_view::substr β std::experimental::basic_string_view::substr
bestie, welcome to the std::experi...iew::substr(3) page from the C++ Standard Libary π
this is your lowkey iconic substring-view moment, and we're gonna get through it together. π«Ά
β¨ Synopsis β¨
okay so here's the signature, copied exactly and looking cute:
constexpr basic_string_view
substr(size_type pos = 0, size_type count = npos ) const;
Basically this returns a view of the substring [pos, pos + rcount), where rcount is the smaller of count and size() - pos. That's the whole main character energy of it. π
π Parameters π
posβ position of the first charactercountβ requested length
π Return value π
View of the substring [pos, pos + rcount). Slay. β¨
π Exceptions π
std::out_of_range if pos > size() β so like, do not go past the end, bestie, or it's gonna throw. π
β‘ Complexity β‘
Constant. Literally constant, no cap. π
π¦ See also π¦
copyβ copies characters (public member function)findβ find characters in the view (public member function)
πΈ Category πΈ
* Noindexed pages
okay that's the whole page, bestie. It's giving std::experi...iew::substr(3) from http://cppreference.com, dated 2024.06.10. Go off and substring responsibly ππ
π¦ where this page comes from
- nixpkgs unstable: stdman 2024.07.05
- opensuse-leap 16.0: stdman 2024.07.05-bp160.1.9 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms