lysstring

package
v0.1.24 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2024 License: MIT Imports: 12 Imported by: 0

README

lysstring

String functions.

Documentation

Overview

Package lysstring contains string functions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ContainsAny

func ContainsAny(slice []string, elements []string) bool

ContainsAny returns true if any string in elements is found in slice

func Convert

func Convert(s, inSep, outSep string, f func(string) string) (res string)

Convert changes value separation of s, e.g. from CSV (,) to TSV (|)

func DeAlias added in v0.1.18

func DeAlias[T ~string](in []T) (out []string)

DeAlias converts []T to []string, where T is an alias of string

func IsAscii added in v0.1.23

func IsAscii(s string) bool

IsAscii returns true if s only contains ASCII chars from https://stackoverflow.com/questions/53069040/checking-a-string-contains-only-ascii-characters

func RemoveCharacters added in v0.1.14

func RemoveCharacters(input string, charsToRemove string) string

RemoveCharacters returns input with the chars in charsToRemove removed from https://socketloop.com/tutorials/golang-remove-characters-from-string-example

func ReplaceAccents added in v0.1.23

func ReplaceAccents(s string) (res string, err error)

ReplaceAccents replaces accent characters such as "ö" with their non-accented equivalents such as "o" from https://twin.sh/articles/33/remove-accents-from-characters-in-go

func Title

func Title(s string) string

Title returns s in title case using non-specific language rules

Types

This section is empty.

Jump to

Keyboard shortcuts

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