diff --git a/src/library/base/man/paste.Rd b/src/library/base/man/paste.Rd index 8ff68f6c80..31fc69af37 100644 --- a/src/library/base/man/paste.Rd +++ b/src/library/base/man/paste.Rd @@ -46,7 +46,8 @@ paste0(\dots, collapse = NULL, recycle0 = FALSE) desirable, e.g.\sspace{}in \code{paste("the value of p is ", p)}. \code{paste0(\dots, collapse)} is equivalent to - \code{paste(\dots, sep = "", collapse)}, slightly more efficiently. + \code{paste(\dots, sep = "", collapse)}, slightly more efficiently + as it avoids handling a separator. If a value is specified for \code{collapse}, the values in the result are then concatenated into a single string, with the elements being diff --git a/src/library/base/man/substr.Rd b/src/library/base/man/substr.Rd index 973b19efb9..f332e6c269 100644 --- a/src/library/base/man/substr.Rd +++ b/src/library/base/man/substr.Rd @@ -98,6 +98,10 @@ substr("abcdef", 2, 4) substring("abcdef", 1:6, 1:6) ## strsplit() is more efficient ... +## Extraction behavior from zero-length strings and empty strings +substr(character(0), 1, 2) # returns character(0) +substring(c("abc", ""), 2) # returns "bc" and "" + substr(rep("abcdef", 4), 1:4, 4:5) x <- c("asfef", "qwerty", "yuiop[", "b", "stuff.blah.yech") substr(x, 2, 5)