Learn R Programming

podcleaner (version 0.1.2)

combine_random_string_if_pattern: Conditionally return a random string

Description

Search for specified pattern in provided string; if found returns a 22 character long random string otherwise return original string.

Usage

combine_random_string_if_pattern(string, regex)

Arguments

string

A character string.

regex

Character string regex specifying the pattern to look for in string.

Value

A length 1 character string vector: 22 character long random string if regex found in string, string otherwise.