mirror of
https://github.com/go-gitea/gitea
synced 2025-07-14 22:47:21 +00:00
Upgrade xorm to v1.1.0 (#15869)
This commit is contained in:
3
vendor/xorm.io/xorm/internal/utils/strings.go
generated
vendored
3
vendor/xorm.io/xorm/internal/utils/strings.go
generated
vendored
@ -8,10 +8,12 @@ import (
|
||||
"strings"
|
||||
)
|
||||
|
||||
// IndexNoCase index a string in a string with no care of capitalize
|
||||
func IndexNoCase(s, sep string) int {
|
||||
return strings.Index(strings.ToLower(s), strings.ToLower(sep))
|
||||
}
|
||||
|
||||
// SplitNoCase split a string by a seperator with no care of capitalize
|
||||
func SplitNoCase(s, sep string) []string {
|
||||
idx := IndexNoCase(s, sep)
|
||||
if idx < 0 {
|
||||
@ -20,6 +22,7 @@ func SplitNoCase(s, sep string) []string {
|
||||
return strings.Split(s, s[idx:idx+len(sep)])
|
||||
}
|
||||
|
||||
// SplitNNoCase split n by a seperator with no care of capitalize
|
||||
func SplitNNoCase(s, sep string, n int) []string {
|
||||
idx := IndexNoCase(s, sep)
|
||||
if idx < 0 {
|
||||
|
Reference in New Issue
Block a user