mirror of
https://github.com/go-gitea/gitea.git
synced 2024-12-12 23:50:00 +08:00
bc4e06109d
The "unit" part shouldn't have bold style.
25 lines
499 B
Go
25 lines
499 B
Go
// 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)
|
|
}
|
|
|
|
func (su *StringUtils) Split(s, sep string) []string {
|
|
return strings.Split(s, sep)
|
|
}
|