Guest User

Untitled

a guest
May 24th, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.31 KB | None | 0 0
  1. String.module_eval do
  2. UTF8_VERTICAL_ELLIPSIS = "\342\200\246" # Unicode character: U+22EE VERTICAL ELLIPSIS
  3.  
  4. def ellipsis_after( len = 60 , tail = nil)
  5. c = self.chars
  6. if c.length > len
  7. return c[0,len] + (tail || UTF8_VERTICAL_ELLIPSIS ) #"..."
  8. else
  9. return self
  10. end
  11. end
  12. end
Add Comment
Please, Sign In to add comment