Strings in Go

Posted by GoDoc
Public (Editable by Users)

Strings sorts a slice of strings in increasing order.

Go
Edit
package main

import (
	"fmt"
	"sort"
)

func main() {
	s := []string{"Go", "Bravo", "Gopher", "Alpha", "Grin", "Delta"}
	sort.Strings(s)
	fmt.Println(s)
}