engine/utils/json.go

14 lines
326 B
Go
Raw Normal View History

2024-02-11 01:31:01 +08:00
package utils
import "strings"
func JsonEscape(in string) string {
in = strings.ReplaceAll(in, "\n", "")
in = strings.ReplaceAll(in, "\t", "")
in = strings.ReplaceAll(in, "\r", "")
in = strings.ReplaceAll(in, "\r\n", "")
in = strings.ReplaceAll(in, "\\\"", "\"")
in = strings.ReplaceAll(in, "\\\\", "\\")
return in
}