aboutsummaryrefslogtreecommitdiff
path: root/content/strings/range.go
diff options
context:
space:
mode:
authorRob Pike <r@golang.org>2013-10-22 23:05:47 -0700
committerRob Pike <r@golang.org>2013-10-22 23:05:47 -0700
commite81e54f7e23b828c2b42d5cf277251dda7511be1 (patch)
treeb52b973a65277b630c96b0671405c864332e16ae /content/strings/range.go
parent88eb9799109ea8009377f18e86be137ec64b3ac4 (diff)
go.blog/strings: blog post about strings
R=golang-dev, dan.kortschak, iant CC=golang-dev https://golang.org/cl/15460049
Diffstat (limited to 'content/strings/range.go')
-rw-r--r--content/strings/range.go14
1 files changed, 14 insertions, 0 deletions
diff --git a/content/strings/range.go b/content/strings/range.go
new file mode 100644
index 0000000..1cd4da0
--- /dev/null
+++ b/content/strings/range.go
@@ -0,0 +1,14 @@
+// Copyright 2013 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package main
+
+import "fmt"
+
+func main() {
+ const nihongo = "日本語"
+ for index, runeValue := range nihongo {
+ fmt.Printf("%#U starts at byte position %d\n", runeValue, index)
+ }
+}