str_extract_before_first: Return portion of a string before first occurrence of a...

View source: R/btools_strings.r

str_extract_before_firstR Documentation

Return portion of a string before first occurrence of a pattern

Description

Return portion of a string before first occurrence of a pattern

Usage

str_extract_before_first(s, first)

Arguments

s

A string.

first

Pattern to look for.

Value

Substring of s before first occurrence of first.

Examples

str_extract_before_first("abcde#yzy", "#")
str_extract_before_first("abcde#yzy", "y")

donboyd5/btools documentation built on Jan. 7, 2023, 10:47 p.m.