fork download
  1. stringg <- c("You are\ngoing to learn 3 things, the first one is not to extract, and\n2 and 3 are simply digits.", "....", "....")
  2. sub("(\\.)$", "\\1$", stringg)
  3. sub("$(?<=\\.)", "$", stringg, perl=TRUE)
  4. library(stringr)
  5. str_replace(stringg, "\\.$", "\\0$")
  6.  
Success #stdin #stdout 0.24s 43308KB
stdin
Standard input is empty
stdout
[1] "You are\ngoing to learn 3 things, the first one is not to extract, and\n2 and 3 are simply digits.$"
[2] "....$"                                                                                              
[3] "....$"                                                                                              
[1] "You are\ngoing to learn 3 things, the first one is not to extract, and\n2 and 3 are simply digits.$"
[2] "....$"                                                                                              
[3] "....$"                                                                                              
[1] "You are\ngoing to learn 3 things, the first one is not to extract, and\n2 and 3 are simply digits.$"
[2] "....$"                                                                                              
[3] "....$"