2032b40f2b
Signed-off-by: Michael Mayer <michael@liquidbytes.net>
15 lines
229 B
Go
15 lines
229 B
Go
package txt
|
|
|
|
import (
|
|
"fmt"
|
|
"strings"
|
|
)
|
|
|
|
// Quote adds quotation marks to a string if needed.
|
|
func Quote(text string) string {
|
|
if strings.ContainsAny(text, " \n'\"") {
|
|
return fmt.Sprintf("“%s”", text)
|
|
}
|
|
|
|
return text
|
|
}
|