package main
import (
"encoding/json"
"fmt"
)
func main() {
str := "Hello, World!"
jsonStr, err := json.Marshal(str)
if err != nil {
fmt.Println("Error encoding JSON")
return
}
fmt.Println(string(jsonStr)) // Output: "Hello, World!"
}
To embed this program on your website, copy the following code and paste it into your website's HTML: