Posted By

sjtai on 05/23/07


Tagged

list csv join split


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

webstic


comma separated placeholder


 / Published in: Ruby
 

  1. values = [1, 2, 3]
  2. # => [1, 2, 3]
  3.  
  4. s = '?' * values.size
  5. # => "???"
  6.  
  7. csv = s.split(//).join(',')
  8. # => "?,?,?"

Report this snippet  

You need to login to post a comment.