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

strHeadR Documentation

Vectorized semantic equivalent of 'head' for a string

Description

Picks the substring starting from the first character

Usage

strHead(string, n)

Arguments

string

string

n

(integer) Number of characters

Details

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

Value

A string

Examples


tidyrules:::strHead(c("string", "string2"), 2)
tidyrules:::strHead(c("string", "string2"), -1)



talegari/tidyrules documentation built on Feb. 7, 2025, 8:47 p.m.