I\'m using std::string and need to left pad them to a given width. What is the recommended way to do this in C++?
std::string
Sample input:
123
string t = string(10, ' ') + to_string(123); cout << t.substr(t.size() - 10) << endl;
Try it online!