gstr

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2024 License: MIT Imports: 7 Imported by: 1

Documentation

Overview

DEPRECATED. use gstrconv package instead

Index

Constants

View Source
const (
	DefaultShortenSuffix = "…"
)

Variables

This section is empty.

Functions

func Atoi added in v0.0.3

func Atoi(s string) (i int)

DEPRECATED. use gstrconv package instead Atoi parses a string into int.

func Atoi64 added in v0.0.3

func Atoi64(s string) (rs int64)

DEPRECATED. use gstrconv package instead Atoi64 parses a string into int64.

func LenUtf8 added in v0.0.3

func LenUtf8(s string) (n int)

func Md5

func Md5(text string) string

Md5 hashes using md5 algorithm.

func Md5FromBytes added in v0.0.8

func Md5FromBytes(data []byte) string

Md5FromBytes hashes a slice of bytes in md5 algorithm.

func ParseDigitFromMixed added in v0.0.3

func ParseDigitFromMixed(s string) (i int)

DEPRECATED. use gstrconv package instead ParseDigitFromMixed parses a digit from a string contains 0-9 and non 0-9 chars.

func ParseFloat32 added in v0.0.3

func ParseFloat32(s string) (i float32)

DEPRECATED. use gstrconv package instead ParseFloat32 parses a string into float32.

func RemoveHtmlTag added in v0.0.5

func RemoveHtmlTag(s string) (rs string)

func Sha1 added in v0.0.3

func Sha1(s string) (rs string)

Sha1 hashes a string in sha1 algorithm.

func Sha1FromBytes added in v0.0.8

func Sha1FromBytes(data []byte) (rs string)

Sha1FromBytes hashes a slice of bytes in sha1 algorithm.

func Shorten

func Shorten(s string, n int) (rs string)

Shorten it cuts and concatenates a part of string with ellipsis if its length long than maxLen in unicode.

func ShortenWith added in v0.0.3

func ShortenWith(s string, n int, suffix string) (rs string)

func StrInSlice

func StrInSlice(haystack []string, needle string) bool

func TrimSubstrings

func TrimSubstrings(haystack string, needles []string) (result string)

TrimSubstrings remove all needles item from haystack.

Types

This section is empty.

Jump to

Keyboard shortcuts

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