
Strings library - cppreference.net
Jan 28, 2025 · The class template std::basic_string generalizes how sequences of characters are manipulated and stored. String creation, manipulation, and destruction are all handled by a …
std::basic_string - cppreference.net
Apr 27, 2025 · The class template basic_string stores and manipulates sequences of character -like objects, which are non-array objects of TrivialType and StandardLayoutType . The class is …
Standard library header <string> - cppreference.net
Nov 27, 2023 · lexicographically compares two strings (function template) std::swap (std::basic_string) specializes the std::swap algorithm (function template) erase …
std::literals::string_literals::operator""s - cppreference.net
Dec 16, 2024 · std::chrono::duration also defines operator""s to represent literal seconds, but it is an arithmetic literal: 10.0s and 10s are ten seconds, but "10" s is a string.
std::basic_stringstream - cppreference.net
Sep 13, 2023 · implements input and output operations on string based streams. It effectively stores an instance of std::basic_string and performs the input and output operations on it.
Standard library header <string_view> (C++17) - cppreference.net
Nov 27, 2023 · basic_string_view <CharT, Traits> str); // basic_string_view typedef names using string_view = basic_string_view <char>; using u8string_view = basic_string_view <char8_t>; …
std::basic_string<CharT,Traits,Allocator>:: - cppreference.net
Dec 11, 2024 · Constructs new string from a variety of data sources and optionally using user supplied allocator alloc . 1) The default constructor since C++11. Constructs an empty string …
std::basic_string_view - cppreference.net
Mar 27, 2025 · Notes It is the programmer's responsibility to ensure that std::string_view does not outlive the pointed-to character array: std::string_view good {"a string literal"}; // "Good" case: …
std::to_string - cppreference.net
May 16, 2024 · Exceptions May throw std::bad_alloc from the std::string constructor. Notes With floating point types std::to_string may yield unexpected results as the number of significant …
std::basic_string<CharT,Traits,Allocator>:: - cppreference.net
Dec 13, 2024 · result. append(3, '*'); assert(result == "***"); // 2) Append a fixed-length C-string result. append(cptr, 5); assert(result == "***C-str"); // 3) Append a null-terminated C-string // …