title: Cleanest way to truncate last items in a comma delimited string?
body: <p>What is the best/cleanest way you know of to take a comma delimited string, such as "A,B,C,D,E,F,G", and return only the 1st x amount of items in the list? So if x = 5 then the result would be "A,B,C,D,E". </p>
  
  <p>I know there are different ways to do this: "for loop" counting commas, then truncate string; split string to array or list, then remove last x amount of items.</p>
  
  <p>Is there a cleaner, more efficient option that I don't know of? How would you go about this?</p>
  
  <p>Thanks in advance!!
  Greg</p>