Snippets has posted 5883 posts at DZone. View Full User Profile
def truncate_words(text, length = 30, end_string = ' â€¦')
words = text.split()
words[0..(length-1)].join(' ') + (words.length > length ? end_string : '')
Discover best practices and the most useful tools for building the ideal integration architecture.
DZone's 170th Refcard is an essential reference to Camel, an open-source, lightweight, integration library. This Refcard is authored by...