xstrings

package
v29.0.0-...-a2903dc Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AllOrSomeFilter

func AllOrSomeFilter(list, filterList []string) []string

AllOrSomeFilter filters elems out from the list as they present in filterList and returns the remaining ones. if filterList is empty, all elems from list returned.

func FormatUsername

func FormatUsername(s string) string

FormatUsername formats a username to make it usable as a variable.

func List

func List(n int, do func(i int) string) []string

List returns a slice of strings captured after the value returned by do which is called n times.

func NoDash

func NoDash(s string) string

NoDash removes dash from the string.

func NoNumberPrefix

func NoNumberPrefix(s string) string

NoNumberPrefix adds an underscore at the beginning of the string if it stars with a number this is used for package of proto files template because the package name can't start with a number.

func StringBetween

func StringBetween(s, start, end string) string

StringBetween returns the string between two other strings. The comparison is not greedy so the between result includes the string between the start value and the first match of the end value.

func Title

func Title(s string) string

Title returns a copy of the string s with all Unicode letters that begin words mapped to their Unicode title case.

func ToUpperFirst

func ToUpperFirst(s string) string

ToUpperFirst returns a copy of the string with the first unicode letter in upper case.

Types

This section is empty.

Jump to

Keyboard shortcuts

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