Hi I have a following strings in my data and would like to replace A1-A9 to A01-A09 and B1-B9 to B01-B09 but keep the numbers >=10
.
rep_data=data.frame(Str= c("A1B10", "A2B3", "A11B1", "A5B10"))
Str
1 A1B10
2 A2B3
3 A11B1
4 A5B10
There is a similar post here but my problem is little bit different! and haven't seen similar example in here str_replace.
Will be very glad if you know the solution.
expected output
Str
1 A01B10
2 A02B03
3 A11B01
4 A05B10