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

Last updated