blob: 8f3b15653c0093071be656ca07006caef67c513e [file] [log] [blame]
David K. Bainbridge215e0242017-09-05 23:18:24 -07001// Copyright 2016 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.
4
5package norm_test
6
7import (
8 "fmt"
9
10 "golang.org/x/text/unicode/norm"
11)
12
13func ExampleForm_NextBoundary() {
14 s := norm.NFD.String("Mêlée")
15
16 for i := 0; i < len(s); {
17 d := norm.NFC.NextBoundaryInString(s[i:], true)
18 fmt.Printf("%[1]s: %+[1]q\n", s[i:i+d])
19 i += d
20 }
21 // Output:
22 // M: "M"
23 // ê: "e\u0302"
24 // l: "l"
25 // é: "e\u0301"
26 // e: "e"
27}