I’m using this:
<% words = article.content.split(/ /) %>
<%= words[0…20] %>
to (ostensibly) split a paragraph into component words, with spaces in
between, then print to html only the first 20 items, words and spaces. I
got this (split(/ /)) from the online pickaxe book at
http://rubycentral.com/book/ref_c_string.html#String.split . The problem
is, the resulting array seems to contain no spaces, only words, and
what’s being printed to html is onehugewordthatlookslikethis.
Am I doing something wrong?