Using the std::string to copy the first len characters into a string.