Back In the print window choose "Save as PDF" as the destination
NOTE.CS

String Functions

1 topic · 28 Nov 2026
1

String Functions

C++
C++
string s = "Hello World";
s.length();              // 11
s.substr(0, 5);          // "Hello"
s.find("World");         // 6 (string::npos if not found)
s += "!";                // append
s.replace(0, 5, "Hi");   // "Hi World!"
toupper(s[0]);           // single char to upper case
stoi("123");             // string → int
to_string(456);          // int → string
getline(cin, s);         // read a full line with spaces