Skip to content

Instantly share code, notes, and snippets.

@basicmag
Created August 13, 2023 22:24
Show Gist options
  • Save basicmag/f8f1a4976653a2bb51b5ff361a414adb to your computer and use it in GitHub Desktop.
Save basicmag/f8f1a4976653a2bb51b5ff361a414adb to your computer and use it in GitHub Desktop.
Go言語: ルーンを使って文字列をループ処理する
// Go言語 必読本 Essential Go
// https://www.amazon.co.jp/dp/B0CF53VMYB
//
// Go言語: ルーンを使って文字列をループ処理する
package main
import (
"fmt"
)
func main() {
s := "日本語"
for i, runeChar := range s {
fmt.Printf("Rune at byte position %d is %#U\n", i, runeChar)
}
}
// Go言語 必読本 Essential Go
// https://www.amazon.co.jp/dp/B0CF53VMYB
//
// Essential Go
// https://www.programming-books.io/essential/go/
// By Krzysztof Kowalczyk
//
// Content is licensed under Creative Commons Attribution-ShareAlike 3.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment