View source: R/split_long_lines.R
split_long_lines | R Documentation |
This function splits long lines at a given number of characters,
keeping words intact. It's basically a wrapper around strwrap()
.
split_long_lines(
x,
length = 60,
collapseResult = FALSE,
splitString = rock::opts$get("utteranceMarker")
)
x |
The string (e.g. a source) |
length |
The maximum length |
collapseResult |
Whether to collapse the result from a vector (with
line breaks separating the elements) to a single character value (where
the vector elements are glued together using |
splitString |
The character to use to split lines. |
A character vector.
cat(
rock::split_long_lines(
paste0(
"Lorem ipsum dolor sit amet, consectetur adipiscing elit. ",
"Vestibulum et dictum urna. Donec neque nunc, lacinia vitae ",
"varius vitae, pretium quis nibh. Aliquam pulvinar, lacus ",
"sed varius vulputate, justo nibh blandit quam, ",
"nec sollicitudin velit augue eget erat."
)
)
);
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.