Created
March 29, 2018 12:03
-
-
Save halllllll/eeffbf021f5ab028672b2fad9c201149 to your computer and use it in GitHub Desktop.
さっき作ったgenerate_alphabet.go を利用してa-zのstring出すやつ
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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