How to replace a alphabet with it's corresponding one?
This could be done by creating two char arrays that consist of alphabet and backward alphabet respectively.
But i am searching for pre defined function to do this as creating two char arrays of 26 elements each would be time consuming plus inefficient.
All chars have an associated decimal number (ascii table )
(ch -‘A’) -> ch - 65
Basically how far from 65 am I => disp
(‘Z‘- disp ) -> 90 - disp
From 90 take away the disp
(char) cast back to a character
You could create 1 alphabet consisting of 26 letters with string indexes ranging from 0 to 25
IE: A = 0, Z = 25
In order to get the reverse letter, you can use
25 - index of letter
A = 0. 25 - 0 = 25 = Z
D = 3. 25 - 3 = 22 = V
Y = 24. 25 - 24 = 1 = B
Of course, you could use different alphabets