CanBackquote in Go

Posted by GoDoc
Public (Editable by Users)

CanBackquote reports whether the string s can be represented unchanged as a single-line backquoted string without control characters other than tab.

Go
Edit
package main

import (
	"fmt"
	"strconv"
)

func main() {
	fmt.Println(strconv.CanBackquote("Fran & Freddie's Diner ☺"))
	fmt.Println(strconv.CanBackquote("`can't backquote this`"))
}