Help us understand the problem. What is going on with this article?

ずんだの表見出し++問題 Go編

More than 1 year has passed since last update.

元ネタ:
ずんだの表見出し++問題 Ruby 編

プログラム

main.go
package main

import (
    "fmt"
    "strconv"
    "strings"
)

const data = `0|col1|col2|col3
1|col1|col2|col3
2|col1|col2|col3
3|col1|col2|col3
4|col1|col2|col3`

func main() {
    for _, s := range strings.Split(data, "\n") {
        r := []rune(s)
        i, _ := strconv.Atoi(string(r[0:1]))
        fmt.Println(i+1, string(r[1:]))
    }
}

出力

1 |col1|col2|col3
2 |col1|col2|col3
3 |col1|col2|col3
4 |col1|col2|col3
5 |col1|col2|col3
mediado
私たちメディアドゥは、電子書籍を読者に届けるために「テクノロジー」で「出版社」と「電子書店」を繋ぎ、その先にいる作家と読者を繋げる「電子書籍取次」事業を展開しております。業界最多のコンテンツラインナップとともに最新のテクノロジーを駆使した各種ソリューションを出版社や電子書店に提供し、グローバル且つマルチコンテンツ配信プラットフォームを目指しています。
https://mediado.jp
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
ユーザーは見つかりませんでした