14 lines
326 B
Go
14 lines
326 B
Go
|
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
|
||
|
}
|