natural

Stars
25

natural

natural string compare

usage

package main

import (
	"fmt"
	"github.com/mattn/natural"
)

func main() {
	a := []string{
		"",
		"1",
		"10",
		"2",
		"20",
	}
	natural.Sort(a)
	for _, s := range a {
		fmt.Println(s) // 1 2 3 10 20 
	}
}

License

This is rewrite of natsort. So made available under the same license as zlib.

Author

Yasuhiro Matsumoto (a.k.a mattn)

Package Rankings
Top 8.05% on Proxy.golang.org