I have a string for example, abcdepzxtru
I want to reverse only a part of the string and I have the beginning and the ending indices of the substring, say 1 and 5, i.e. I need to reverse abcde
part of abcedpzxtru
and the output should be edcbapzxtru
I am not sure how to do this in R and googling around is not very helpful.