String zfill() - JanKulbaga/String-CPP GitHub Wiki
Returns a new string with 0 characters padded to the left side of the given string.
#include <ostream>
#include "src/String.h"
int main()
{
String s = "Hello";
std::cout << s.zfill(10) << "\n";
std::cout << s.zfill(5) << "\n";
return 0;
}Output:
00000Hello
Hellosize_t num
Returns a new string with 0 filled to the left.