str_get_between_separators: Return everything between first occurence of first separator...

View source: R/str_get_between_separators.R

str_get_between_separatorsR Documentation

Return everything between first occurence of first separator and first occurence of second separator after the first separator.

Description

Return everything between first occurence of first separator and first occurence of second separator after the first separator.

Usage

str_get_between_separators(
  string = "",
  first_separator = ",",
  second_separator = ",",
  include_sep_in_output = FALSE
)

Arguments

string

A character string.

first_separator

Optional. Default ",".

second_separator

Optional. Default ",".

include_sep_in_output

Optional. Include the separators in the output. Default FALSE.

Examples

str <- "I am smart enough, good looking enough, and gosh darn it; people like me."
get_between_separators(str)
[1] "good looking enough"
str_get_between_separators(str, second_separator = ";")
[1] "good looking enough, and gosh darn it"

uva-bi-sdad/dc.utils documentation built on Aug. 1, 2022, 1:45 a.m.