str.replace | R Documentation |
Replaces in str every occurence of pattern by replacement
## S3 method for class 'replace' str(str, pattern, replacement, fixed = TRUE, perl = FALSE, ignore = NULL, ignore.pos = NULL, only.pos = NULL, ignore.pattern = "_IGNORE_", ...)
str |
the string to replaced |
pattern |
the substring to be replaced |
replacment |
the new substrings |
a string
## Not run: str = c("12345678901234567890") pattern = c("34","12") replacement = c("AB","Holla die Waldfee") pos = cbind(1,10) str.replace(str,pattern,replacement, ignore.pos=pos) str.replace(str,pattern,replacement, only.pos=pos) str.replace(str,pattern,replacement) str = "int{5*2}*{2*3}" pattern = "int{_IGNORE_}" replacement = "integer{_IGNORE_}" pos = cbind(c(5,11),c(7,13)) str.replace(str,pattern,replacement, ignore.pos=pos) ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.