Else , simply subtract 1
else { a = a . replace ( a [ i ] , String . fromCharCode ( ( ( a [ i ] . charCodeAt ( 0 ) - ' ' . charCodeAt ( 0 ) ) - 1 ) + ' ' . charCodeAt ( 0 ) ) ) ; break ; } } } return a . toString ( ) ; }