qax-os / excelize

Go language library for reading and writing Microsoft Excel™ (XLAM / XLSM / XLSX / XLTM / XLTX) spreadsheets
https://xuri.me/excelize
BSD 3-Clause "New" or "Revised" License
17.64k stars 1.69k forks source link

为什么sheet不支持区分大小写?( Why does sheet not support case sensitivity?) #1856

Closed 15083787153 closed 3 months ago

15083787153 commented 3 months ago

目前看库内部使用的strings.EqualFold来比较两个sheet的名字,但是这个函数是不支持区分大小写的。

比如我想将默认的Sheet1改成sheet1,无法直接更改,只能改成另外一个名字,再将这个名字改为sheet1

Currently, the library uses strings.EqualFold internally to compare the names of two sheets, but this function does not support case sensitivity.

For example, I want to change the default Sheet1 to sheet1. I cannot change it directly. I can only change it to another name, and then change the name to sheet1.

xuri commented 3 months ago

Thanks for your issue. This issue has been fixed, please upgrade to the master branch by go get -u github.com/xuri/excelize/v2@master, and this patch will be released in the next version.

15083787153 commented 3 months ago

Thanks for your issue. This issue has been fixed, please upgrade to the master branch by go get -u github.com/xuri/excelize/v2@master, and this patch will be released in the next version.

感谢的你的快速回应,如果这是一个bug的话,影响的地方不仅仅是SetSheetName这个函数,还有DeleteSheet这个函数,内部使用的是GetSheetIndex,也许还有更多地方 = = Thank you for your quick response. If this is a bug, it affects not only the SetSheetName function, but also the DeleteSheet function, which uses GetSheetIndex internally. Maybe there are more = =

xuri commented 3 months ago

Thanks for your feedback. The sheet name is not case-sensitive by default, you can't create two sheet names "Sheet1" and "sheet1" on a workbook, so I think just need to change the behavior of the SetSheetName function.