Description Usage Arguments Value Note See Also Examples
This function 'slices' the strings of a character vector
x
at consecutive indices n
, thereby
generating consecutive substrings of length n
and
returning the result as a list. Not safe for use with
unicode characters.
1 | str_slice(x, n = 1)
|
x |
a character vector. |
n |
integer (or numeric coercible to integer); index at which to slice. |
A list of length equal to the length of x
, with each
element made up of the substrings generated from
x[i]
.
Underlying code is written in C for fast execution.
str_slice2
, for slicing a UTF-8 encoded
vector.
1 2 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.