string

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package string is a collection of small reusable Go functions

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Capitalize

func Capitalize(str string) string

Capitalizes the first letter of a string.

func CapitalizeTitle

func CapitalizeTitle(input string, omitWords ...[]string) string

Capitalizes string excluding words such as "and", "a", "with", "or". You can provide an optional string slice with words that will be excluded too

func CaseInsensitiveEquals

func CaseInsensitiveEquals(firstString, secondString string) bool

Return true if both strings are case insensitive equal

func DeleteWhitespace

func DeleteWhitespace(str string) string

Deletes all whitespaces from a String

func GetMD5Hash

func GetMD5Hash(text string) string

converts a string to an MD5 hash

func Humanize

func Humanize(inputStr string) string

Converts a computerized string into a human-friendly one

func IndexOf

func IndexOf(inputStr string, substring string) int

Returns index of the specified character or substring in a particular String

func IsBlank

func IsBlank(inputStr string) bool

Returns true if string is blank

func IsBoolean

func IsBoolean(inputStr string) bool

Determines whether the string is a boolean representation

func IsEmpty

func IsEmpty(inputStr string) bool

Returns true if string is empty

func IsEmptyOrBlank

func IsEmptyOrBlank(inputStr string) bool

Returns true if string is empty or blank

func IsFloat

func IsFloat(inputStr string) bool

Determines whether the string is a float representation

func IsInteger

func IsInteger(inputStr string) bool

Determines whether the string is a integer representation

func LowerCamelCase

func LowerCamelCase(inputStr string) (outputString string)

Convert string to lowerCamelCase

func RemoveAccents

func RemoveAccents(s string) string

Removes the accents from a string, converting them to their non-accented corresponding characters.

func ToKebabCase

func ToKebabCase(s string) string

Converts a string to Kebab Case

func ToSnakeCase

func ToSnakeCase(s string) string

Converts a string to Snake Case

func Truncate

func Truncate(inputStr string, length int) string

Truncates a string up to a specified string length

func UnifyWordSeries

func UnifyWordSeries(words []string, conjunction string) string

Transforms a list of words into a word series, returning a string containing all words separated by commas and the conjunction

func UpperCamelCase

func UpperCamelCase(inputStr string) (outputString string)

Convert string to UpperCamelCase

Types

This section is empty.

Jump to

Keyboard shortcuts

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