Go Slices String Slice Sort

Description

Go Slices String Slice Sort

package main/*from   ww w . j  ava 2s  .  c om*/

import (
  "fmt"
  "sort"
)
func main() {

  fmt.Println("String Reverse Sort")
  text := []string{"C++","UK","Javascript","CSS HTML","Python"}
  sort.Sort(sort.Reverse(sort.StringSlice(text)))
  fmt.Println(text)
  
}



PreviousNext

Related