{"author_name":"yuheiomori0718","blog_title":"\u30e1\u30e2\u7f6e\u304d\u5834","image_url":null,"version":"1.0","author_url":"https://blog.hatena.ne.jp/yuheiomori0718/","provider_url":"https://hatena.blog","published":"2013-10-07 00:01:23","title":"Go\u8a00\u8a9e\u3067\u6587\u5b57\u5217\u306e\u6587\u5b57\u6570\u3092\u53d6\u5f97\u3059\u308b","height":"190","blog_url":"https://y0m0r.hateblo.jp/","provider_name":"Hatena Blog","type":"rich","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fy0m0r.hateblo.jp%2Fentry%2F20131007%2F1381158083\" title=\"Go\u8a00\u8a9e\u3067\u6587\u5b57\u5217\u306e\u6587\u5b57\u6570\u3092\u53d6\u5f97\u3059\u308b - \u30e1\u30e2\u7f6e\u304d\u5834\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","width":"100%","description":"len(string)\u3060\u3068\u30d0\u30a4\u30c8\u9577\u3092\u8fd4\u3059\u3002 utf8.RuneCountInString\u3092\u4f7f\u3046\u3068\u6587\u5b57\u6570\u3092\u53d6\u5f97\u3067\u304d\u305f\u3002 package main import ( \"fmt\" \"unicode/utf8\" ) func main() { s := \"\u3042\u3044\u3046\u3048\u304a\" // \u5165\u529b\u5024 fmt.Printf(\"%v\\n\", s) // -> \u3042\u3044\u3046\u3048\u304a // len(s)\u306f\u30d0\u30a4\u30c8\u9577\u3092\u8fd4\u3059 fmt.Printf(\"%v\\n\", len(s)) // -> 15 // byte\u914d\u5217\u306b\u5909\u63db byteArray := []byte(s) fmt.Printf(\"%#v\\n\", byteArray) // -> [\u2026","url":"https://y0m0r.hateblo.jp/entry/20131007/1381158083","categories":["golang"]}