#####  [ cppreference.com ](/)

[ Log in ](/mwiki/index.php?title=Special:UserLogin&returnto=cpp%2Fstring "You
are encouraged to log in; however, it is not mandatory \[o\]")

#####  Namespaces

  * [ Page ](/w/cpp/string "View the content page \[c\]")
  * [ Discussion ](/mwiki/index.php?title=Talk:cpp/string&action=edit&redlink=1 "Discussion about the content page \[t\]")

#####  Variants

#####  Views

  * [ View ](/w/cpp/string)
  * [ Edit ](/mwiki/index.php?title=cpp/string&action=edit "You can edit this page. Please use the preview button before saving \[e\]")
  * [ History ](/mwiki/index.php?title=cpp/string&action=history "Past revisions of this page \[h\]")

#####  Actions

#  Strings library

From cppreference.com

< [ cpp ](/w/cpp "cpp")

[ C++ ](/w/cpp "cpp")

[ Compiler support ](/w/cpp/compiler_support "cpp/compiler support")  
---  
[ Freestanding and hosted ](/w/cpp/freestanding "cpp/freestanding")  
[ Language ](/w/cpp/language "cpp/language")  
[ Standard library ](/w/cpp/standard_library "cpp/standard library")  
[ Standard library headers ](/w/cpp/header "cpp/header")  
[ Named requirements ](/w/cpp/named_req "cpp/named req")  
[ Feature test macros ](/w/cpp/feature_test "cpp/feature test") (C++20)  
[ Language support library ](/w/cpp/utility#Language_support "cpp/utility")  
[ Concepts library ](/w/cpp/concepts "cpp/concepts") (C++20)  
[ Metaprogramming library ](/w/cpp/meta "cpp/meta") (C++11)  
[ Diagnostics library ](/w/cpp/error "cpp/error")  
[ General utilities library ](/w/cpp/utility "cpp/utility")  
**Strings library**  
[ Containers library ](/w/cpp/container "cpp/container")  
[ Iterators library ](/w/cpp/iterator "cpp/iterator")  
[ Ranges library ](/w/cpp/ranges "cpp/ranges") (C++20)  
[ Algorithms library ](/w/cpp/algorithm "cpp/algorithm")  
[ Numerics library ](/w/cpp/numeric "cpp/numeric")  
[ Localizations library ](/w/cpp/locale "cpp/locale")  
[ Input/output library ](/w/cpp/io "cpp/io")  
[ Filesystem library ](/w/cpp/filesystem "cpp/filesystem") (C++17)  
[ Regular expressions library ](/w/cpp/regex "cpp/regex") (C++11)  
[ Concurrency support library ](/w/cpp/thread "cpp/thread") (C++11)  
[ Technical specifications ](/w/cpp/experimental "cpp/experimental")  
[ Symbols index ](/w/cpp/symbol_index "cpp/symbol index")  
[ External libraries ](/w/cpp/links/libs "cpp/links/libs")  
  
[ [edit]
](https://en.cppreference.com/mwiki/index.php?title=Template:cpp/navbar_content&action=edit)

**Strings library**

[ Null-terminated strings ](/w/cpp/string#Null-terminated_strings
"cpp/string")  
---  
[ Byte strings ](/w/cpp/string/byte "cpp/string/byte")  
[ Multibyte strings ](/w/cpp/string/multibyte "cpp/string/multibyte")  
[ Wide strings ](/w/cpp/string/wide "cpp/string/wide")  
Classes  
[ basic_string  ](/w/cpp/string/basic_string "cpp/string/basic string")  
[ basic_string_view  ](/w/cpp/string/basic_string_view "cpp/string/basic
string view") (C++17)  
[ char_traits  ](/w/cpp/string/char_traits "cpp/string/char traits")  
  
[ [edit]
](https://en.cppreference.com/mwiki/index.php?title=Template:cpp/string/navbar_content&action=edit)

##  Contents

  * 1  Characters 
  * 2  Library components 
    * 2.1  Character traits 
    * 2.2  String classes (  std::string  etc.) 
    * 2.3  String view classes (  std::string_view  etc.) 
    * 2.4  Null-terminated sequence utilities 
  * 3  Relevant libraries 
  * 4  Defect reports 
  * 5  See also 

  
---  
  
###  [ [ edit ](/mwiki/index.php?title=cpp/string&action=edit&section=1 "Edit
section: Characters") ]  Characters

In the C++ standard library, a _character_ is an object which, when treated
sequentially, can represent text.

The term means not only objects of [ character types ](/w/cpp/language/type
"cpp/language/type") , but also any value that can be represented by a type
that provides the definitions specified in the strings library and following
libraries:

  * [ localization library ](/w/cpp/locale "cpp/locale")
  * [ input/output libr