1#' Check if a string is titlecase. 2#' 3#' Return \code{TRUE} if the string is a titlecased string and there is at least one 4#' character, for example uppercase characters may only follow uncased characters and lowercase 5#' characters only cased ones. Return \code{FALSE} otherwise. 6#' 7#' @param str A character vector. 8#' 9#' @return A logical vector. 10#' 11#' @references \url{https://docs.python.org/3/library/stdtypes.html#str.istitle} 12#' 13#' @examples 14#' pystr_istitle("I Am A Title") 15#' pystr_istitle("I Am not A Title") 16#' 17#' @export 18pystr_istitle <- function(str) { 19 return(vapply(str, function(x) x == pystr_title(x), logical(1), USE.NAMES = FALSE)) 20} 21