char code if A-9

by techsin

JavaScript

function $(i) {
    var s='', c;
    Array.prototype.forEach.call(i, function (e) {
        c = e.charCodeAt();
        ((c>64&&c<90)||(c>96&&c<122))?c++:((c == 90)?c=65:(c==122&&(c=97)));
        s += String.fromCharCode(c);
    });
    return s;
}

console.log($('abczABC @-@'));