2023-04-22 20:16:22 +02:00
|
|
|
// Copyright 2023 The Gitea Authors. All rights reserved.
|
|
|
|
// SPDX-License-Identifier: MIT
|
|
|
|
|
|
|
|
package templates
|
|
|
|
|
|
|
|
import "strings"
|
|
|
|
|
|
|
|
type StringUtils struct{}
|
|
|
|
|
|
|
|
func NewStringUtils() *StringUtils {
|
|
|
|
return &StringUtils{}
|
|
|
|
}
|
|
|
|
|
|
|
|
func (su *StringUtils) HasPrefix(s, prefix string) bool {
|
|
|
|
return strings.HasPrefix(s, prefix)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (su *StringUtils) Contains(s, substr string) bool {
|
|
|
|
return strings.Contains(s, substr)
|
|
|
|
}
|
2023-04-28 23:23:19 +02:00
|
|
|
|
|
|
|
func (su *StringUtils) Split(s, sep string) []string {
|
|
|
|
return strings.Split(s, sep)
|
|
|
|
}
|