ConvertToJSONString takes a string, and returns a JSON string, with any illegal characters escaped.
(s string)
| 197 | |
| 198 | // ConvertToJSONString takes a string, and returns a JSON string, with any illegal characters escaped. |
| 199 | func ConvertToJSONString(s string) string { |
| 200 | b, _ := JSONMarshal(s) |
| 201 | return string(b) |
| 202 | } |
| 203 | |
| 204 | // Concatenates and merges multiple string arrays into one, discarding all duplicates (including |
| 205 | // duplicates within a single array.) Ordering is preserved. |