utils_paste_if_found: Conditionally amend character string vector.

Description Usage Arguments Value Examples

Description

Searches for specified pattern in provided character string. Return pasted provided character string(s) if found or provided default character string if not.

Usage

1
utils_paste_if_found(regex_filter, string_filter, default, ignore_case, ...)

Arguments

regex_filter

Pattern to look for provided as a character string regex.

string_filter

Character string vector to search into for the pattern provided in regex_filter above.

default

Character string returned if pattern provided in regex_filter not found.

ignore_case

Boolean specifying whether case should be ignored (TRUE) or not (FALSE).

...

Character string(s) to be paste together using a space as separator and returned if pattern provided in regex_filter found.

Value

A character string vector.

Examples

1
2
3
4
5
6
7
## Not run: 
  utils_paste_if_found(
    "^glasgow", c("glasgow-entrepreneurs", "aberdeen-entrepreneurs"),
    "pattern not found", TRUE, "pattern", "found"
  )

## End(Not run)

podcleaner documentation built on Jan. 12, 2022, 1:06 a.m.