Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

replacechar

Replace a character in a string by another


Description

replacechar replaces a character in a string by another, deprecated!

Usage

replacechar(str, char = "_", newchar = ".")
# is gsub(char, newchar,str)

Arguments

str

The string to be altered.

char

The character to be replaced.

newchar

The character to replace with.

Value

The altered string.

Author(s)

Christian W. Hoffmann <christian@echoffmann.ch> adapted from tjoelker@redwood.rt.cs.boeing.com (Rod Tjoelker 865-3197)

Examples

replacechar("my_queer_file,name") # "my.queer.file,name"
replacechar("my_queer_file,name","m","M") # "My.queer.file,naMe"

cwhmisc

Miscellaneous Functions for Math, Plotting, Printing, Statistics, Strings, and Tools

v6.6
GPL (>= 2)
Authors
Christian W. Hoffmann
Initial release
2018-08-24, 10:40:10

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.