
Last chance! 50% off unlimited learning
Sale ends in
str_sub(string, start=0, end=Inf)
sub_str
will replicate all arguments to be the same length as
the longest argument. If any arguments are of length 0, the output
will be a zero length character vector.substring
which this function wrapshw <- "Hadley Wickham"
str_sub(hw, 1, 6)
str_sub(hw, end = 6)
str_sub(hw, 8, 14)
str_sub(hw, 8)
str_sub(hw, c(1, 8), c(6, 14))
str_sub(hw, seq_len(str_length(hw)))
str_sub(hw, end = seq_len(str_length(hw)))
Run the code above in your browser using DataLab