replace.String: Replaces all occurrences of oldChar in this string with...

Description Usage Arguments Value Author(s) Examples

Description

Replaces all occurrences of oldChar in this string with newChar.

Usage

1
2
## S3 method for class 'String'
replace(this, oldChar, newChar, ...)

Arguments

oldChar

The old character.

newChar

The new character.

Value

Returns the new string.

Author(s)

Henrik Bengtsson (http://www.braju.com/R/)

Examples

1
2
3
  s <- String("Hello world!")
  replace(s, "!", ".")                        # "Hello world."
  replace(String("Hello world!"), "!", ".")   # "Hello world."

HenrikBengtsson/R.lang documentation built on May 8, 2019, 7:50 p.m.