![](/style/images/good.png)
5
![](/style/images/bad.png)
[Golang] Sort Words Alphabetically
source link: http://siongui.github.io/2018/04/10/go-sort-words-alphabetically/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
[Golang] Sort Words Alphabetically
April 10, 2018
Go standard library provides sort.Strings to help us sort words alphabetically. The following example comes from Go official site.
package main import ( "fmt" "sort" ) func main() { s := []string{"Go", "Bravo", "Gopher", "Alpha", "Grin", "Delta"} sort.Strings(s) fmt.Println(s) }
References:
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK