strings

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2021 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsURL

func IsURL(s string) bool

IsURL returns whether the given string is a valid URL.

func JoinInt64

func JoinInt64(ints []int64, delimiter string) string

JoinInt64 joins a list of int64 into a single string with the given delimiter.

func JoinLines

func JoinLines(s string) string

JoinLines joins each lines of the given string by replacing the newlines by a single space.

func Pluralize

func Pluralize(word string, count int) string

Pluralize adds an `s` at the end of word if the count is more than 1.

func Prepend

func Prepend(text string, prefix string) string

Prepend prefixes each lines of a string with the given prefix. It can be used to indent or quote (> ) a paragraph, for example.

func RemoveDuplicates

func RemoveDuplicates(strings []string) []string

RemoveDuplicates keeps only unique strings in the source.

func SplitLines

func SplitLines(s string) []string

SplitLines splits a string by the newlines character in a portable way Using only `strings.Split(s, "\n")` doesn't work on Windows.

Types

This section is empty.

Jump to

Keyboard shortcuts

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