Reputation: 1
If I wanted to simply replace a letter or a number with one immediately preceding it, how would I go about that? For example, I wanted to replace the letter 'c' with 'b' in my code, or 3 with 2. Any tips?
Upvotes: 0
Views: 112
Reputation: 2147
The "char" type is numeric, and you can subtract one from it to get the answer you want. Work out what you want to do with '0' or 'a'.
Upvotes: 1