sub_string: Extract and replace substrings from a character vector.
Description
sub_string extracts substrings under code point-based index ranges provided. sub_string<- allows to substitute parts of a string with given strings.
Usage
sub_string(string, from = 1L, to = -1L)
sub_string(string, from = 1L, to = -1L) <- value
Arguments
string
input character vector.
from
an integer vector or a two-column matrix. from gives the position of the first character (defaults to first). Negative values count backwards from the last character.
to
an integer vector. to gives the position of the last (defaults to last character).
value
replacement string
Value
A character vector of substring from start to end
(inclusive). Will be length of longest input argument.