stringg <- c("You are\ngoing to learn 3 things, the first one is not to extract, and\n2 and 3 are simply digits.", "....", "....")
sub("(\\.)$", "\\1$", stringg)
sub("$(?<=\\.)", "$", stringg, perl=TRUE)
library(stringr)
str_replace(stringg, "\\.$", "\\0$")
