hard_split: hard_split splits the output of strings at a specific width

View source: R/cap.out.R

hard_splitR Documentation

hard_split splits the output of strings at a specific width

Description

Each string is split in pieces that have that length (or less for the last part of the string)

Usage

hard_split(strings, width = getOption("width", 110) - 3)

Arguments

strings

A vector of strings

width

The width (length) that each line will have (at most). Default getOption('width',110)-3

acknowledgements

I was glad to be able to use the following (idea for) code from a StackOverflow article by akrun.

Examples


hard_split(paste(letters,collapse =''),width=10)


HanOostdijk/HOQCutil documentation built on July 28, 2023, 5:56 p.m.