Shorten Character Strings
1 2 3 4 5 6 7 8 9 | shorten_string(
x,
min_len = 3,
max_len = 10,
max_total = 18,
sep = " ",
outsep = "_",
cruft_pattern = "[aeiou\\-]"
)
|
x |
a vector of characters. |
min_len |
the minimum length a string can be without being dropped. Default 3. |
max_len |
the maximum length a string can be. If it's longer it gets truncated. Default 10. |
max_total |
the maximum total size of the shortened string. Default 18. |
sep |
the string separators. Default " ". |
outsep |
the shortened string separator. Default "_". |
cruft_pattern |
the regex desribing the characters that will be dropped from the string. |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.