The default behavior of String#split will throw away any trailing values if they are empty.
> "Hello,There,,".split(',')
=> ["Hello", "There"]
If you want to keep those empty trailing elements, pass a negative number for the second (limit) parameter.
> "Hello,There,,".split(',', -1)
=> ["Hello", "There", "", ""]
This tip was submitted by two-bit-fool.
You can use HTML tags for formatting. Wrap code in <code> tags and multiple lines of code in <pre><code> tags.