DescTools (version 0.99.18)

StrChop: Split a String in a Number of Pieces With Fixed Length

Description

Split a string in a number of pieces with fixed length

Usage

StrChop(x, len)

Arguments

x
the string to be cut in pieces.

len
a vector with the lengths of the pieces.

Value

Details

If length is going over the end of the string the last part will be returned.

See Also

FixToTab

Examples

Run this code
x <- paste(letters, collapse="")
StrChop(x=x, len = c(3,5,2))

Run the code above in your browser using DataCamp Workspace