list

package module
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2022 License: Apache-2.0 Imports: 1 Imported by: 3

README

list

GoDoc Go Report Card Build Status Codecov Version

Simple List-Manipulation Utilities for Go

This library doesn't do anything earth-shattering, but it DOES replicate a number of useful functions that I miss from other languages. Feel free to use, or add to this library accordingly.

Pull Requests Welcome

This library is a work in progress, and will benefit from your experience reports, use cases, and contributions. If you have an idea for making Rosetta better, send in a pull request. We're all in this together!

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func At

func At(value string, delimiter string, index int) string

At returns the list vaue at a particular index

func Head(value string, delimiter string) string

Head returns the FIRST item in a string-based-list

func Last

func Last(value string, delimiter string) string

Last returns the LAST item in a string-based-list

func LastDelim added in v0.4.1

func LastDelim(value string, delimiter string) string

LastDelim returns the LAST item in a string-based-list

func PushHead added in v0.3.0

func PushHead(value string, newValue string, delimiter string) string

PushHead adds a new item to the beginning of the list

func PushTail added in v0.3.0

func PushTail(value string, newValue string, delimiter string) string

PushTail adds a new item to the end of the list

func RemoveLast added in v0.2.0

func RemoveLast(value string, delimiter string) string

RemoveLast returns the full list, with the last element removed.

func Split

func Split(value string, delimiter string) (string, string)

Split returns the FIRST element, and the REST element in one function call

func SplitTail added in v0.4.0

func SplitTail(value string, delimiter string) (string, string)

SplitTail behaves like Split, but splits the beginning of the list from the last item in the list. So, the list "a,b,c" => "a,b", "c"

func Tail

func Tail(value string, delimiter string) string

Tail returns any values in the string-based-list AFTER the first item

Types

This section is empty.

Jump to

Keyboard shortcuts

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