getExtension {utilitiesR}R Documentation

get the extension of input path(s)

Description

get the extension of input path(s)

Usage

  getExtension(paths, preserveCase = FALSE)

Arguments

paths

the path(s) to get the extension of

preserveCase

boolean, default FALSE. Whether or not to preserve the case of the extension. If FALSE, returns lowercase.

Value

the extension(s) of the path, being the text from the last '.' to the end. If no extension, returns ”.

See Also

Other file: createFilename, getFilename, getUniqueFilename, makeIfNotExists

Examples

getExtension( 'a/b/c.def' ) # 'def'
getExtension( 'a/b' )       # '' (no extension)
getExtension(c('a/b.png','c/d/e.jpg')) # "png" "jpg"

[Package utilitiesR version 1.8.2 Index]