Learn R Programming

tidyrules (version 0.2.7)

strHead: Vectorized semantic equivalent of 'head' for a string

Description

Picks the substring starting from the first character

Usage

strHead(string, n)

Value

A string

Arguments

string

string

n

(integer) Number of characters

Details

'n' can be in the interval [-len + 1, len] (both ends inclusive)

Examples

Run this code
# \donttest{
tidyrules:::strHead(c("string", "string2"), 2)
tidyrules:::strHead(c("string", "string2"), -1)
# }

Run the code above in your browser using DataLab