Skip to content

Instantly share code, notes, and snippets.

@halllllll
Created March 29, 2018 12:03
Show Gist options
  • Save halllllll/eeffbf021f5ab028672b2fad9c201149 to your computer and use it in GitHub Desktop.
Save halllllll/eeffbf021f5ab028672b2fad9c201149 to your computer and use it in GitHub Desktop.
さっき作ったgenerate_alphabet.go を利用してa-zのstring出すやつ
package main
import (
"fmt"
)
func craetea2z() string {
alphabet := make([]rune, 0)
for cur := []rune("a"); ; cur[0] += 1 {
alphabet = append(alphabet, cur[0])
if string(cur[0]) == "z" {
break
}
}
return string(alphabet)
}
func main() {
alphabet := craetea2z()
fmt.Println(alphabet)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment