strings

package
v2.0.0-beta2.0...-6ef21df Latest Latest
Warning

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

Go to latest
Published: May 18, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package strings provides extended functionality for string types

Index

Constants

This section is empty.

Variables

View Source
var ErrKeyNotInMap = errors.New("key not found in map")

ErrKeyNotInMap represents an error for key not found in map

Functions

func CloneBoolMap

func CloneBoolMap(in map[string]bool) map[string]bool

CloneBoolMap returns an exact copy of a map consisting string key and bool value

func Equal

func Equal(s1, s2 []string) bool

Equal returns true if the slices contain identical values in the identical order

func IndexInSlice

func IndexInSlice(arr []string, val string) int

IndexInSlice returns the index of a string element in a given slice

func Substring

func Substring(s string, i int, length int) string

Get s[i:i+length]. Returns an empty string if i+length > len(s)

func Unique

func Unique(in []string) []string

Unique returns a uniqueified version of the list

Types

type Lookup

type Lookup map[string]interface{}

Lookup represents a map[string]interface{} with assumed nil values

type StringMap

type StringMap map[string]string

StringMap represents a map[string]string

func (StringMap) GetInt

func (m StringMap) GetInt(key string) (int, error)

GetInt returns an integer value from the map, if convertible If not, an error is returned with a value of 0

func (StringMap) String

func (m StringMap) String() string

Jump to

Keyboard shortcuts

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