1 // Copyright 2013 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
12 func ExampleUnquote() {
13 test
:= func(s
string) {
14 t
, err
:= strconv
.Unquote(s
)
16 fmt
.Printf("Unquote(%#v): %v\n", s
, err
)
18 fmt
.Printf("Unquote(%#v) = %v\n", s
, t
)
23 // If the string doesn't have quotes, it can't be unquoted.
24 test(s
) // invalid syntax
31 // Unquote("cafe\\u0301"): invalid syntax
32 // Unquote("`cafe\\u0301`") = cafe\u0301
33 // Unquote("\"cafe\\u0301\"") = café
34 // Unquote("'\\u00e9'") = é