Use StringReplace with RuleDelayed to replace each integer digit character in the following strings with a digit that is 1 less than the number represented by the digit character. (Hint: Use DigitCharacter, ToString and ToExpression.)
The solution provided by the instructor is:
I think either there is typographical error with the solution provided or I am missing something. The only difference between the input and output is removal of "" with the strings.
To the best of my understanding, what the problem demands is conversion of integers to 1 less. For instance, "a3bykmn" will have a2bykmn as output.The Set Delayed will ensure the output as a1bykmn the next time. But what after a0bykmn. Will it be a-0bykmn?
On refreshing the notebook,indeed the expected output is
Nevertheless, answer provided by the experts helpful.