mirror of
https://github.com/quarkcloudio/quark-go.git
synced 2025-09-27 04:15:54 +08:00
16 lines
266 B
Go
16 lines
266 B
Go
package excel
|
|
|
|
// 生成 Excel 中的列标签
|
|
func GenerateColumnLabel(index int) string {
|
|
|
|
var columnLabel string
|
|
|
|
for index > 0 {
|
|
mod := (index - 1) % 26
|
|
columnLabel = string(rune('A'+mod)) + columnLabel
|
|
index = (index - 1) / 26
|
|
}
|
|
|
|
return columnLabel
|
|
}
|