Core Java. String manipulation. In given string swap specific characters.
Posted on 2016-07-25
There is a word. You need to swap ( replace by each other ) first letter "m" and the last letter "p" . Also you should consider the possibility that such letters won't be in a given word.
For example :
input : mamapapa
output: sorry there isn't any "p" letter in the word
output: sorry there isn't any "m" letter in the word.
Many thxs in advance !