Learn R Programming

BioGeoBEARS (version 0.2.1)

slashslash: Remove double slash (slash a slash)

Description

Shortcut for: gsub(pattern="//", replacement="/", x=tmpstr)

Usage

slashslash(tmpstr)

Arguments

tmpstr
a path that you want to remove double slashes from

Value

outstr a string of the fixed path

Details

This function is useful for removing double slashes that can appear in full pathnames due to inconsistencies in trailing slashes in working directories etc.

See Also

getwd, setwd, gsub

Examples

Run this code
tmpstr = "/Library/Frameworks//R.framework/Versions/"

outstr = slashslash(tmpstr)
outstr

Run the code above in your browser using DataLab