stringsutil

package
v1.0.0-victorialogs Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppendLowercase added in v1.97.7

func AppendLowercase(dst []byte, s string) []byte

AppendLowercase appends lowercase s to dst and returns the result.

It is faster alternative to strings.ToLower.

func JSONString added in v1.97.7

func JSONString(s string) string

JSONString returns JSON-quoted s.

func LessNatural added in v1.97.7

func LessNatural(a, b string) bool

LessNatural returns true if a is less than b using natural sort comparison.

See https://en.wikipedia.org/wiki/Natural_sort_order

func LimitStringLen

func LimitStringLen(s string, maxLen int) string

LimitStringLen limits the length of s with maxLen.

If len(s) > maxLen, then s is replaced with "s_prefix..s_suffix", so the total length of the returned string doesn't exceed maxLen.

Types

This section is empty.

Jump to

Keyboard shortcuts

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