stringutils

package
v0.0.0-...-eb8f901 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2025 License: Apache-2.0 Imports: 2 Imported by: 2

Documentation

Index

Constants

View Source
const DefaultMaskLength = 10

DefaultMaskLength is the mask length of masked string

Variables

This section is empty.

Functions

func MaskString

func MaskString(str string, visibleLength int, maskCharacter string, maskRight bool) string

MaskString takes string as argument and keep a visibleLength number of charators and mask maskCharacter is used to generate the masked part of the string It can mask the charators from either left or right hand side of the string depending on maskRight boolean It returns the masked string

func MaskToken

func MaskToken(token string) string

MaskToken masks the token with "*" character and keeps last four charaters visible

func RemoveString

func RemoveString(slice []string, s string) []string

RemoveString returns a newly created []string that contains all items from slice that are not equal to s.

func StringInSlice

func StringInSlice(a string, list []string) bool

StringInSlice checks whether a given string is included in the slice

func ToStringArray

func ToStringArray[T any](array []T) []string

ToStringArray returns the vHosts related to an API.

Types

This section is empty.

Jump to

Keyboard shortcuts

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