str

package
v0.0.0-...-1763559 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2024 License: MIT Imports: 9 Imported by: 1

Documentation

Overview

Package str :: reverse.go

Package str :: reverseWords.go

Package str :: runes.go

Package str :: sort.go

Package str :: str.go

Index

Constants

This section is empty.

Variables

View Source
var (
	// ByCaseInsensitivity is a By function for string sorting
	ByCaseInsensitivity = By(LessByCaseInsensitivity)
	// ByLength is a By function for string sorting
	ByLength = By(LessByLength)
)

Functions

func ByCaseInsensitive

func ByCaseInsensitive(s []string)

ByCaseInsensitive sort case-insensitive strings

func CompareByLength

func CompareByLength(a, b *string) int

CompareByLength compares strings by length

func ComparebyCaseInsensitive

func ComparebyCaseInsensitive(a, b *string) int

ComparebyCaseInsensitive compares strings by case-insensitivity

func LessByCaseInsensitivity

func LessByCaseInsensitivity(a, b *string) bool

LessByCaseInsensitivity compares strings by case-insensitivity

func LessByLength

func LessByLength(a, b *string) bool

LessByLength compares strings by length

func Reverse

func Reverse(s string) string

Reverse a string

func ReverseWords

func ReverseWords(s string) string

ReverseWords reverses a string by words

Types

type By

type By func(p1, p2 *string) bool

By is a "Less" function type defines how to sort strings

func (By) Sort

func (by By) Sort(data []string)

Sort is a sorting method for By

type Runes

type Runes []rune

Runes type represents array of runes, aka `[]rune`

func (Runes) Reverse

func (s Runes) Reverse() Runes

Reverse method returns a copy of reversed Runes/[]runes

func (Runes) String

func (s Runes) String() string

type Str

type Str string

Str type is an alias to string

func (*Str) Compress

func (s *Str) Compress() string

Compress returns a compressed string to omit repeats

func (*Str) Decompress

func (s *Str) Decompress() string

Decompress returns a decompressed string

Jump to

Keyboard shortcuts

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