Picks the substring starting from the first character

strHead(string, n)

Arguments

string

string

n

(integer) Number of characters

Value

A string

Details

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

Examples

# \donttest{ tidyrules:::strHead(c("string", "string2"), 2)
#> [1] "st" "st"
tidyrules:::strHead(c("string", "string2"), -1)
#> [1] "strin" "string"
# }