The equivalent in R is sprintf
:
year = "2008"
mnth = "1"
day = "31"
url = sprintf("https:.../KBOS/%s/%s/%s/DailyHistory.html", year, mnth, day)
#[1] "https:.../KBOS/2008/1/31/DailyHistory.html"
Also, although I think it is an overkill, you could define an operator yourself too.
`%--%` <- function(x, y) {
do.call(sprintf, c(list(x), y))
}
"https:.../KBOS/%s/%s/%s/DailyHistory.html" %--% c(year, mnth, day)
#[1] "https:.../KBOS/2008/1/31/DailyHistory.html"
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…