extract_prefix: extract_prefix

Description Usage Arguments Details Value Examples

View source: R/prefix_operation.R

Description

Extract and return the word prefix based on a string separator

Usage

1
extract_prefix(word, separator)

Arguments

word

string, the word from which the prefix is to be extracted.

separator

string, the separator between the prefix and the word.

Details

extract_prefix split a word an returns the word prefix based on a string.

Value

returns the word prefix.

Examples

1
2
3
4
5
str <- "abc"
extract_prefix(str, "b")

str <- "B_column"
prefix <- extract_prefix(str, "_")

JeremyGillard/somar documentation built on March 19, 2021, 10:50 a.m.