gstrings

package
v0.0.0-...-3e416e1 Latest Latest
Warning

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

Go to latest
Published: May 19, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BytesToString

func BytesToString(b []byte) string

func ContainsAll

func ContainsAll(str string, sub ...string) bool

func ContainsAny

func ContainsAny(str string, sub ...string) bool

func HasHTTPPrefix

func HasHTTPPrefix(str string) bool

func HasPrefixAny

func HasPrefixAny(str string, prefix ...string) bool

func HasSuffixAny

func HasSuffixAny(str string, suffix ...string) bool

func Render

func Render(str string, data map[string]string) string

Render replaces ${var} or $var in the string based on the mapping data, 'var' is key in data map.

func Replace

func Replace(str string, oldNew ...string) string

Replace str from a list of old, new string pairs. Replacements are performed in the order they appear in the target string, without overlapping matches. The old string comparisons are done in argument order.

Replace panics if given an odd number of oldNew arguments.

func StringToBytes

func StringToBytes(s string) []byte

Types

This section is empty.

Jump to

Keyboard shortcuts

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