andyzinsser andyzinsser - 1 year ago 77
Javascript Question

What is a method that can be used to increment letters?

Does anyone know of a Javascript library (e.g. underscore, jQuery, MooTools, etc.) that offers a method of incrementing a letter?

I would like to be able to do something like:

"a"++; // would return "b"

Answer Source
function nextChar(c) {
    return String.fromCharCode(c.charCodeAt(0) + 1);
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download