pystr_replace: Replace substrings within a string.

Description Usage Arguments Details Value References Examples

View source: R/pystr_replace.R

Description

Return a copy of the string with all occurrences of substring old replaced by new.

Usage

1
pystr_replace(str, old, new, count = nchar(str) + 2)

Arguments

str

A character vector.

old

A character vector.

new

A character vector.

count

A numeric vector.

Details

If the optional argument count is given, only the first count occurrences are replaced.

Value

A character vector.

References

https://docs.python.org/3/library/stdtypes.html#str.replace

Examples

1
2
pystr_replace("123123123", "2", "two")
pystr_replace("123123123", "2", "two", 2)

nicolewhite/pystr documentation built on May 23, 2019, 5:09 p.m.