R/rm_space_before_period.R

Defines functions rm_space_before_period

Documented in rm_space_before_period

#' Remove spaces before period
#' @description This function takes a string such as "Mary had a little lamb ." or "Mary had a little lamb ..." and removes the unecessary space to "Mary had a little lamb.".
#' @importFrom stringr str_replace_all
#' @export

rm_space_before_period <-
        function(x) {
                stringr::str_replace_all(x, "([ ]{1})([.]{1,3})", "\\2")
        }
patelm9/centipede documentation built on Dec. 4, 2020, 3:09 a.m.