1% Generated by roxygen2 (4.1.1): do not edit by hand 2% Please edit documentation in R/pystr_replace.R 3\name{pystr_replace} 4\alias{pystr_replace} 5\title{Replace substrings within a string.} 6\usage{ 7pystr_replace(str, old, new, count = nchar(str) + 2) 8} 9\arguments{ 10\item{str}{A character vector.} 11 12\item{old}{A character vector.} 13 14\item{new}{A character vector.} 15 16\item{count}{A numeric vector.} 17} 18\value{ 19A character vector. 20} 21\description{ 22Return a copy of the string with all occurrences of substring \code{old} replaced by \code{new}. 23} 24\details{ 25If the optional argument \code{count} is given, only the first \code{count} occurrences are replaced. 26} 27\examples{ 28pystr_replace("123123123", "2", "two") 29pystr_replace("123123123", "2", "two", 2) 30} 31\references{ 32\url{https://docs.python.org/3/library/stdtypes.html#str.replace} 33} 34 35