powered by
Extract substrings from a character vector in C++.
character
substrC(x, pos, len)
A character vector of the same length as 'x'.
A character vector.
The start point of the substring as integer. Position indications start from 1L, which is the default in R.
integer
1L
The length of the substring as integer.
https://cplusplus.com/reference/string/string/substr/, substr().
substr()
substrC("Hello, world!", pos = 1, len = 5)
Run the code above in your browser using DataLab