This repository has been archived on 2022-09-04. You can view files and clone it, but cannot push or open issues or pull requests.
api/utils/find_string_with_prefix.go
Kichiyaki 01fdd80f7f [WIP] - refactor limit, sort, offset
- rename middleware.MayExceedLimit to CanExceedLimit
- update the DailyTribeStats/DailyPlayerStats repository and usecase
- rename utils.SanitizeSort to utils.SanitizeSortExpression
- add two new utils - SanitizeSortExpressions and FindStringWithPrefix
2020-11-21 09:13:25 +01:00

13 lines
188 B
Go

package utils
import "strings"
func FindStringWithPrefix(sl []string, prefix string) string {
for _, s := range sl {
if strings.HasPrefix(s, prefix) {
return s
}
}
return ""
}