MCPcopy Create free account
hub / github.com/dropbox/godropbox / EscapeForLike

Function EscapeForLike

database/sqlbuilder/expression.go:363–365  ·  view source on GitHub ↗
(s string)

Source from the content-addressed store, hash-verified

361var likeEscaper = strings.NewReplacer("_", "\\_", "%", "\\%")
362
363func EscapeForLike(s string) string {
364 return likeEscaper.Replace(s)
365}
366
367// Returns an escaped literal string
368func Literal(v interface{}) Expression {

Callers 1

TestLikeExprMethod · 0.85

Calls 1

ReplaceMethod · 0.65

Tested by 1

TestLikeExprMethod · 0.68