addchar: Insert Characters into an Existing String

Description Usage Arguments Author(s) Examples

Description

Given a string, and a starting position, this function will enlarge the string to include additional characters.

Usage

1
addchar(string, characters, position)

Arguments

string

Character. A string of class character.

characters

Character. A string containing the additional characters to insert.

position

Numeric. The position within string where characters should be added.

Author(s)

Ryan Kyle, ryan.kyle@mail.mcgill.ca

Examples

1
2
3
4
5
# Returns "The quick brown fox jumps over the lazy dog."
orig_string <- "The brown fox jumps over the lazy dog."
new_string  <- "quick "

addchar(orig_string, new_string, 4)

rpkyle/cscmisc documentation built on May 13, 2019, 12:06 p.m.