title: Splitting strings and re-ordering in ruby
body: <p>I'm trying to rearrange a string that contains a full name so that the second name is displayed before the first name. </p>
  
  <p>I've managed to split the string using the code below, however when I build it seems to be returning in array format ["second name", "first name"] rather than a string "second name, "first name". </p>
  
  <p>Any help appreciated! </p>
  
  <pre><code>def name_shuffler(str)
     name_parts = str.split(" ")
     first_name, last_name = name_parts[1], name_parts[0]
  end
  </code></pre>