github.com/icodeface/tls@v0.0.0-20230910023335-34df9250cd12/internal/x/text/unicode/norm/example_test.go (about) 1 // Code generated by running "go run gen.go -core" in golang.org/x/text. DO NOT EDIT. 2 3 // Copyright 2016 The Go Authors. All rights reserved. 4 // Use of this source code is governed by a BSD-style 5 // license that can be found in the LICENSE file. 6 7 package norm_test 8 9 import ( 10 "fmt" 11 12 "github.com/icodeface/tls/internal/x/text/unicode/norm" 13 ) 14 15 func ExampleForm_NextBoundary() { 16 s := norm.NFD.String("Mêlée") 17 18 for i := 0; i < len(s); { 19 d := norm.NFC.NextBoundaryInString(s[i:], true) 20 fmt.Printf("%[1]s: %+[1]q\n", s[i:i+d]) 21 i += d 22 } 23 // Output: 24 // M: "M" 25 // ê: "e\u0302" 26 // l: "l" 27 // é: "e\u0301" 28 // e: "e" 29 }