Added function to sanitize strings by escaping quotes (#2360)

This commit is contained in:
Ankit Chawla
2022-02-21 12:44:27 +05:30
committed by GitHub
parent f45d85f30a
commit fe5e5f592b
7 changed files with 61 additions and 1 deletions
+6
View File
@@ -205,3 +205,9 @@ func DownloadUrl(ctx context.Context, httpClient *http.Client, url string, local
return nil
}
func EscapeQuotes(str string) string {
replacer := strings.NewReplacer("\n", "", "\r", "", "\t", "", `"`, `\"`)
str = replacer.Replace(str)
return str
}