wes d2a2ba9e15 first commit | hace 4 años | |
---|---|---|
.. | ||
README.md | hace 4 años | |
code.cpp | hace 4 años | |
unitTest.cpp | hace 4 años |
by Alex Golubov tags: strings, sorting
Create a function that accepts a string (of a persons first and last name) and returns a string with the first and last name swapped. Examples nameShuffle("Donald Trump") ➞ "Trump Donald" nameShuffle("Rosie O'Donnell") ➞ "O'Donnell Rosie" nameShuffle("Seymour Butts") ➞ "Butts Seymour" Notes There will be exactly one space between the first and last name. I
Create a function that accepts a string (of a persons first and last name) and returns a string with the first and last name swapped.
nameShuffle("Donald Trump") ➞ "Trump Donald"
nameShuffle("Rosie O'Donnell") ➞ "O'Donnell Rosie"
nameShuffle("Seymour Butts") ➞ "Butts Seymour"