String.civilize
civilize() -> string
Description
Fix obnoxious patterns in a user-submitted string, by applying these filters:
- Convert excess caps to lower-case
- Break lines over 80 characters long
- Truncate excessive repetition (e.g.
.....
,?????
) - Shrink excess whitespace and newlines
$comment = 'AAAAAAAAAH HELP ME FIX THIS!!!!!!!!!' $comment.civilize() //= 'Aaah help me fix this!'