What\'s the best way to truncate a string to the first n words?
n = 3 str = "your long long input string or whatever" str.split[0...n].join(' ') => "your long long" str.split[0...n] # note that there are three dots, which excludes n => ["your", "long", "long"]