#' Title
#'
#' @param x
#' @param split
#'
#' @return
#' @export
#'
#' @examples
str_split_one <- function(string, pattern, n = Inf) {
stopifnot(is.character(string), length(string) <= 1)
if (length(string) == 1) {
stringr::str_split(string = string, pattern = pattern, n = n)[[1]]
} else {
character()
}
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.