Files
end f9befa1b0a refactor: split dbx package into domain files
Reorganize monolithic dbx.go and utility.go into focused files by
concern, add package doc.go, and gitignore coverage.out.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-29 17:46:54 -07:00

14 lines
353 B
Go

package dbx
import "strings"
// StringToFilter processes a string to be used as a filter in an SQL LIKE
// statement. It replaces all spaces with % and adds % to the beginning and
// end of the string.
func StringToFilter(str string) string {
str = strings.Trim(str, "%")
str = strings.ReplaceAll(str, " ", "%")
str = "%" + str + "%"
return str
}