wes d2a2ba9e15 first commit vor 4 Jahren
..
README.md d2a2ba9e15 first commit vor 4 Jahren
code.cpp d2a2ba9e15 first commit vor 4 Jahren
unitTest.cpp d2a2ba9e15 first commit vor 4 Jahren

README.md

Shuffle the Name

by Alex Golubov tags: strings, sorting

Summary

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

Instructions

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.
  • If you get stuck on a challenge, find help in the Resources tab.
  • If you're really stuck, unlock solutions in the Solutions tab.