sort

package
v0.0.0-...-13c8884 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 5, 2019 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

字符串和数字排序 1.如果能转成数字, 则转成数字比较;2.数字排在字符串前;3.升序排列

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func StringNums

func StringNums(a []*Element)

Types

type Element

type Element struct {
	Num    int
	Str    string
	IsNum  bool
	CanNum bool
}

func NewElementNum

func NewElementNum(num int) *Element

func NewElementStr

func NewElementStr(str string) *Element

type ElementSlice

type ElementSlice []*Element

func (ElementSlice) Len

func (this ElementSlice) Len() int

func (ElementSlice) Less

func (this ElementSlice) Less(i, j int) bool

func (ElementSlice) Swap

func (this ElementSlice) Swap(i, j int)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL