AZ := []string{} a := 'A' for i := 0; i < 26; i++ { AZ = append(AZ, string(a+rune(i))) }
column_num := 26 * (1 + 26) AZPlus := []string{} for i := 0; i < column_num; i++ { if i < 26 { AZPlus = append(AZPlus, AZ[i]) continue } u, v := i/26-1, i%26 AZPlus = append(AZPlus, AZ[u]+AZ[v]) }
A B C D...X Y Z AA AB AC AX AY AZ BA BB BC ... BX BY BZ ....ZA ZB ZC ...ZX ZY ZZ
翻译
搜索
复制
标签:...,26,string,列名,excel,生成,AZPlus,AZ,append From: https://www.cnblogs.com/papering/p/17495861.html