sql.go 183 B

12345678
  1. package sqltil
  2. import "strings"
  3. //转义like语法的%_符号
  4. func EscapeLike(keyword string) string {
  5. return strings.Replace(strings.Replace(keyword,"_","\\_",-1),"%","\\%",-1)
  6. }