strings

package
v2.0.0-rc2 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2025 License: Apache-2.0 Imports: 5 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 EscapeQuotes

func EscapeQuotes(s string) string

func IsApparentSQLDateFormat

func IsApparentSQLDateFormat(s string) bool

IsApparentSQLDateFormat is a rudimentary check that the input appears to be in SQL Format by matching a '####-##-## ##:##:##' format. No actual dates or times are parsed, so strings like '3928-31-28 88:73:95' would match.

func Pare

func Pare(s, exclude []string) []string

Pare returns a new version of s that excludes values present in exclude

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]any

Lookup represents a map[string]any with assumed nil values

type Map

type Map map[string]string

Map represents a map[string]string

func (Map) GetInt

func (m Map) 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 (Map) String

func (m Map) String() string

Jump to

Keyboard shortcuts

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