strings

package
v0.0.0-...-8d1786a Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2020 License: Apache-2.0 Imports: 6 Imported by: 7

Documentation

Overview

Package strings contains various common utils for strings

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsValidContractAddress

func IsValidContractAddress(address string) bool

IsValidContractAddress returns true is the given string matches a valid smart contract address

func IsValidEthAPIURL

func IsValidEthAPIURL(url string) bool

IsValidEthAPIURL returns true if the given string matches a valid eth endpoint URL

func ListCommonAddressToListString

func ListCommonAddressToListString(addresses []common.Address) []string

ListCommonAddressToListString converts a list of common.address to list of string

func ListCommonAddressesToString

func ListCommonAddressesToString(addresses []common.Address) string

ListCommonAddressesToString converts a list of common.address to a comma delimited string

func ListIntToListString

func ListIntToListString(listInt []int) []string

ListIntToListString converts a list of big.int to a list of string

func ListStringToListCommonAddress

func ListStringToListCommonAddress(addresses []string) []common.Address

ListStringToListCommonAddress converts a list of strings to list of common.address

func RandomHexStr

func RandomHexStr(n int) (string, error)

RandomHexStr generates a hex string from a byte slice of n random numbers.

func StrOrEmptyStr

func StrOrEmptyStr(s *string) string

StrOrEmptyStr returns an empty string if a string pointer is nil. Otherwise returns the string value of the pointer.

func StrToPtr

func StrToPtr(s string) *string

StrToPtr is a convenience func that converts a string to it's pointer

func StringToCommonAddressesList

func StringToCommonAddressesList(addresses string) []common.Address

StringToCommonAddressesList converts a comma delimited string to a list of common.address

Types

This section is empty.

Jump to

Keyboard shortcuts

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