比如A->B,AA->AB,Z->AA
参考https://blog.csdn.net/xiaotao2004/article/details/75096607
C#版本,改写为javascipt版本
//获取字符递增 function GetNextChars(letter) { var letterTemp = letter.toUpperCase(); var length = letterTemp.length; var res = 0; for (var i = 0; i < length; i++) { res = res * 26 + letterTemp.charCodeAt(i) - 65 + 1; } res++; var endCol = ''; var endColSignal = ''; var iCnt = Math.round(res / 26); if (res >= 26 && res % 26 === 0) { var icell = iCnt - 2; endCol = (icell < 0 ? "" : String.fromCharCode(65 + icell)) + 91; } else { endColSignal = (iCnt === 0 ? "" : String.fromCharCode(65 + (iCnt - 1))); var icell1 = res - iCnt * 26 - 1; if (icell1 < 0) icell1 = 0; endCol = endColSignal + String.fromCharCode(65+ icell1); } return endCol; }