Strings
The substr(pos, len)
method can be used to get the substring of a string starting at pos
and spanning len
characters.
std::string my_name("Jose Gonzales");
// Prints out "Jose".
std::cout << my_name.substr(0, 4) << std::endl;
// Prints out "Gonzales".
std::cout << my_name.substr(5, 8) << std::endl;
Your task is to create a program which takes the a date in the MM/DD/YYYY
format and convert it into the way superior YYYY-MM-DD
format (ISO 8601).
04/20/2020
2020-04-20