diff options
Diffstat (limited to 'modules/templates/util_string.go')
-rw-r--r-- | modules/templates/util_string.go | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/modules/templates/util_string.go b/modules/templates/util_string.go new file mode 100644 index 0000000000..e86bbe9e70 --- /dev/null +++ b/modules/templates/util_string.go @@ -0,0 +1,20 @@ +// 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) +} |