Go sort Package StringSlice()

Description

Go sort Package StringSlice()

package main//ww  w  .j a  v  a2 s  .c  o  m

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