Problème
Take the first letter of each word in full_name, uppercase it, and join the letters. Words are separated by one or more spaces.
Implement initials(full_name).
Input
full_name: A name made of letters and spaces.
Output
Return the initials, for example "ADL".
Contraintes
1 ≤ length of full_name ≤ 200; it contains at least one letter
Exemples
Entrée :
full_name = "Ada Lovelace"
Sortie attendue :
expected = "AL"
Entrée :
std::string full_name = "Ada Lovelace";
Sortie attendue :
std::string expected = "AL";
Entrée :
string full_name = "Ada Lovelace";
Sortie attendue :
string expected = "AL";
Explication
A from Ada and L from Lovelace: "AL".
Entrée :
full_name = "grace brewster hopper"
Sortie attendue :
expected = "GBH"
Entrée :
std::string full_name = "grace brewster hopper";
Sortie attendue :
std::string expected = "GBH";
Entrée :
string full_name = "grace brewster hopper";
Sortie attendue :
string expected = "GBH";
Explication
Extra spaces don't matter; the initials are uppercased: "GBH".
Références
Ce défi a été adapté pour CodeUtility. Suivez l'énoncé et les contraintes ci-dessus.