strutil

package
v2.3.0 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddNewLineFlag

func AddNewLineFlag(pattern string) string

AddNewLineFlag adds a flag that allows . to match new line character "\n". It assumes that the pattern does not have any flags.

func CapitalizeFirstRune

func CapitalizeFirstRune(str string) string

CapitalizeFirstRune converts first rune to uppercase, and converts rest of the string to lower case.

func HumanizeBytes

func HumanizeBytes(b int64) string

HumanizeBytes takes a byte-size and returns a human-readable string

func JSON

func JSON(v interface{}) string

JSON is a helper function for creating JSON-encoded strings.

func MatchFromStartToEnd

func MatchFromStartToEnd(pattern string) string

MatchFromStartToEnd enforces that the regex will match the full string

func WildCardToRegexp

func WildCardToRegexp(pattern string) string

WildCardToRegexp converts a wildcarded expresiion to equivalent regular expression

Types

This section is empty.

Jump to

Keyboard shortcuts

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