enforceTrailingSlash = function(folder) {
enforceEdgeCharacter(folder, appendChar="/")
}
enforceEdgeCharacter = function(string, prependChar="", appendChar="") {
if (string=="" | is.null(string)) {
return(string)
}
if(!is.null(appendChar)) {
if (substr(string,nchar(string), nchar(string)) != appendChar) { # +1 ?
string = paste0(string, appendChar)
}
}
if (!is.null(prependChar)) {
if (substr(string,1,1) != prependChar) { # +1 ?
string = paste0(prependChar, string)
}
}
return(string)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.