wes d2a2ba9e15 first commit | 4 年之前 | |
---|---|---|
.. | ||
README.md | 4 年之前 | |
code.cpp | 4 年之前 | |
unitTest.cpp | 4 年之前 |
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"