str_slice: String Slice

View source: R/strings.R

str_sliceR Documentation

String Slice

Description

Slice/split a string into multiple lines by the desired length of the line.

Usage

str_slice(x, n = 80L)

str_slice_by_word(x, n = 80L)

Arguments

x

A character vector

n

Integer, the length of the line split

Value

A character vector

Examples

if (requireNamespace("stringi")) {
  x <- stringi::stri_rand_lipsum(1)
  str_slice(x)
  str_slice_by_word(x, n = 50L)
}

mark documentation built on May 29, 2024, 5:13 a.m.