how do i swap the char 'a' with 'd' in the string this sentence.Poster does not say about vice versa
I'm not a native English-speaker, but I think
swap is not the same as
replace, which is what you are referring to. Swap indeed means that the two items in questions switch their places, so there really is no "vice versa" - both happen at the same time.
One possibility would be to replace 'a' by a completey different character -which you can be sure does not otherwise occur in the string-, then replace 'd' by 'a', and then the other character by 'd'.