Documentation ¶
Overview ¶
Package str :: conv.go - extended string formatter functions
Package str :: palindrome.go
Package str :: str.go - extended string functions
Index ¶
- func Append(slice, data []byte) []byte
- func FormatNumber(number uint64) string
- func FromNumber(number uint64) string
- func GetPalindromicSubstring(str string) string
- func IndentJSON(data interface{}, indent string) string
- func IsPalindrome(input interface{}) (bool, error)
- func IsPalindromeNumber(input uint64) bool
- func IsPalindromePhase(input string) bool
- func IsPalindromeString(input string) bool
- func ReplaceProxyURL(url, prefix, proxyURL string) string
- func StringIn(stringInput string, stringList []string, options ...bool) bool
- func ToCamel(in string, keepAllCaps ...bool) string
- func ToSnake(in string) string
- func TranslateNumber(number uint64, xFunc TranslateFunc) string
- func TranslateTo(lang string, number uint64) string
- type Palindrome
- type PalindromeNumber
- type PalindromeString
- type TranslateFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FormatNumber ¶
FormatNumber returns a comma delimited decimal string
func FromNumber ¶
FromNumber returns an English words representation for a number. ex. 1024 => "one thousand twenty four"
func GetPalindromicSubstring ¶
GetPalindromicSubstring returns the longest palindromic substring
func IndentJSON ¶
IndentJSON formats data object with indented JSON string.
func IsPalindrome ¶
IsPalindrome checks if interface{} is palindrome
func IsPalindromeNumber ¶
IsPalindromeNumber checks if an input number is palindrome
func IsPalindromePhase ¶
IsPalindromePhase checks if an input string is palindrome phase
func IsPalindromeString ¶
IsPalindromeString checks if an input string is palindrome
func ReplaceProxyURL ¶
ReplaceProxyURL searches prefix in url and replaces with proxyURL
func ToSnake ¶
ToSnake converts a string to snake case format with unicode support See also https://github.com/serenize/snaker/blob/master/snaker.go
func TranslateNumber ¶
func TranslateNumber(number uint64, xFunc TranslateFunc) string
TranslateNumber translates a number to string by specific function.
func TranslateTo ¶
TranslateTo returns a string representation of number by specific language.
Types ¶
type Palindrome ¶
Palindrome interface
type PalindromeNumber ¶
type PalindromeNumber struct {
// contains filtered or unexported fields
}
PalindromeNumber struct
func (*PalindromeNumber) GetData ¶
func (p *PalindromeNumber) GetData() string
GetData returns input data
func (*PalindromeNumber) IsPalindrome ¶
func (p *PalindromeNumber) IsPalindrome() bool
IsPalindrome checks if an input number is palindrome
type PalindromeString ¶
type PalindromeString struct {
// contains filtered or unexported fields
}
PalindromeString struct
func (*PalindromeString) GetData ¶
func (p *PalindromeString) GetData() string
GetData returns input data
func (*PalindromeString) GetSubstring ¶
func (p *PalindromeString) GetSubstring() string
GetSubstring returns the longest palindromic substring
func (*PalindromeString) IsPalindrome ¶
func (p *PalindromeString) IsPalindrome() bool
IsPalindrome checks if an input string is palindrome
func (*PalindromeString) IsPalindromePhase ¶
func (p *PalindromeString) IsPalindromePhase() bool
IsPalindromePhase checks if an input string is palindrome phase
type TranslateFunc ¶
TranslateFunc defines a type of function to translate number (uint64) to string.