I have the following:
\"0014-06-30\"
And I\'d like to change it to:
\"0000-06-30\"
How would I do this in
I couldn't get the specific format by converting to as.Date. A regex option would be
as.Date
regex
str1 <- "0014-06-30" as.Date(str1) #[1] "14-06-30" sub('\\d{2}(?=-)', '00', str1, perl=TRUE) #[1] "0000-06-30"