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