mirror of
https://codeberg.org/forgejo/forgejo
synced 2024-12-01 14:26:10 +01:00
21 lines
411 B
Go
21 lines
411 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)
|
||
|
}
|