xstrings

package module
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NumericCompare added in v1.1.0

func NumericCompare(a, b string) int

NumericCompare compares strings with respect to values of nonnegative integer groups. For example, 'a9z' is considered less than 'a11z', because 9 < 11. If two numbers with leading zeroes have the same value, the shortest of them is considered less, i.e. 12 < 012. Digits and non-digits are compared lexicographically, i.e. ' ' (space) < 5 < 'a'.

func NumericLess

func NumericLess(a, b string) bool

NumericLess is a shortcut for NumericCompare(a, b) < 0.

func NumericSort

func NumericSort(s []string)

NumericSort sorts the given slice using NumericCompare.

Types

This section is empty.

Jump to

Keyboard shortcuts

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