last.n.char: String Manipulations

View source: R/last.n.char.R

last.n.charR Documentation

String Manipulations

Description

String functions; last.n.char returns the last ā€˜nā€™ characters of the input string

Usage

last.n.char(x, n)

Arguments

x

string; length > n

n

integer; number of characters to be returned

Value

string; length (n)

Author(s)

Angus H Wright ICRAR angus.wright@icrar.org

See Also

measure.fluxes, read.par.file

Examples


#Load LAMBDAR
library(LAMBDAR)

#Show the last 6 characters of a random string
string<-"Methinks it is like a weasel"
print(last.n.char(string,6))

#Is the last character of the filename a '/'?
path<-getwd()
#Using getwd alone: No
last.n.char(path,1)=="/"
#Using getwd and file.path: Yes
last.n.char(file.path(path,""),1)=="/"


AngusWright/LAMBDAR documentation built on May 12, 2022, 1:49 a.m.