Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- String.module_eval do
- UTF8_VERTICAL_ELLIPSIS = "\342\200\246" # Unicode character: U+22EE VERTICAL ELLIPSIS
- def ellipsis_after( len = 60 , tail = nil)
- c = self.chars
- if c.length > len
- return c[0,len] + (tail || UTF8_VERTICAL_ELLIPSIS ) #"..."
- else
- return self
- end
- end
- end
Add Comment
Please, Sign In to add comment