If text is longer than length,text will be
truncated to the length of length (defaults to 30) and the last
characters will be replaced with the truncate_string (defaults to
"…").

Examples

truncate("Once upon a time in a world far far away",14)# => Once upon a...truncate("Once upon a time in a world far far away")# => Once upon a time in a world f...truncate("And they found that many people were sleeping better.",25,"(clipped)")# => And they found that many (clipped)truncate("And they found that many people were sleeping better.",15,"... (continued)")# => And they found... (continued)

If text is longer than length, text will be truncated to the length of
length (defaults to 30) and the last characters will be replaced with the
truncate_string (defaults to “…”).

Examples

truncate("Once upon a time in a world far far away",14)# => Once upon a...truncate("Once upon a time in a world far far away")# => Once upon a time in a world f...truncate("And they found that many people were sleeping better.",25,"(clipped)")# => And they found that many (clipped)truncate("And they found that many people were sleeping better.",15,"... (continued)")# => And they found... (continued)