#include <print> #include <string> int main() { std::string s = "hello world"; // substr(pos, len) copies out a piece std::println("{}", s.substr(0, 5)); std::println("{}", s.substr(6)); }
copy a range of characters