> For the complete documentation index, see [llms.txt](https://blog.gomchik.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://blog.gomchik.com/tech/c++/string.md).

# String

```
#include <string>                // Include string (std namespace)

string s;                        // Create strings

s = "hello";                     // assign

s.size();                        // number of characters in string
        
s[0];                            // 'h'

s.substr(m, n);                  // Substring of size n starting at s[m]

s = to_string(12.05);            // Converts number to string

reverse(s.begin(), s.end());     // reverse a string

```
