mindoc/utils/sqltil/sql.go

9 lines
183 B
Go
Raw Normal View History

2018-12-24 15:23:17 +08:00
package sqltil
import "strings"
//转义like语法的%_符号
func EscapeLike(keyword string) string {
return strings.Replace(strings.Replace(keyword,"_","\\_",-1),"%","\\%",-1)
}