이 기사에서는 Excel 열 이름을 기반으로 인덱스를 얻기위한 Java 프로그래밍 방법에 대해 설명합니다. 다음과 같이 참조에 대해 공유하십시오.
원칙:
[A1-Z26]*26^N-1 + [A1-Z26]*26^N-2 + ... + [A1-Z26]*26^0
특정 코드는 다음과 같습니다.
/ * * 템플릿을 선택하고 편집기에서 템플릿을 엽니 다 {public static int getcellnum (string cellstr) {cellstarray = cellstr.touppercase () int len = int n = 0; ; i ++) {n+= (((int) cellstarray [i])*math.pow (26, len-i-1)} public static void main; ] args) {system.out.print (getCellNum ( "aaa"))}.이 기사가 모든 사람의 Java 프로그래밍에 도움이되기를 바랍니다.