mindoc/utils/sqltil/sql.go

9 lines
183 B
Go

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