R/str_left.R

Defines functions str_left

Documented in str_left

#' Return the n number of characters from the left
#'
#' Wrapper convenience function
#' Analagous to `str_right()`
#'
#' @param x String character to pass through
#' @param n Integer specifying the number of characters to return from the left.
#'
#' @importFrom stringr str_sub
#'
#' @examples
#' str_left("Wittgenstein", 7)
#'
#' @export
str_left <- function(x, n){
  str_sub(x, 1, n)
}
martinctc/textworks documentation built on Oct. 5, 2022, 8:09 p.m.