natural string compare
package main
import (
"fmt"
"github.com/mattn/natural"
)
func main() {
a := []string{
"3",
"1",
"10",
"2",
"20",
}
natural.Sort(a)
for _, s := range a {
fmt.Println(s) // 1 2 3 10 20
}
}
This is rewrite of natsort. So made available under the same license as zlib.
Yasuhiro Matsumoto (a.k.a mattn)