text

package
v0.5.4 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2023 License: Apache-2.0 Imports: 3 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ToTitle

func ToTitle(word string) string

Types

type CaseFormat

type CaseFormat string

CaseFormat defines case format

const (
	CaseFormatUndefined                  = ""
	CaseFormatUpper           CaseFormat = "upper"
	CaseFormatLower           CaseFormat = "lower"
	CaseFormatUpperCamel      CaseFormat = "upperCamel"
	CaseFormatLowerCamel      CaseFormat = "lowerCamel"
	CaseFormatTitle           CaseFormat = "title"
	CaseFormatSentence        CaseFormat = "sentence"
	CaseFormatUpperUnderscore CaseFormat = "upperUnderscore"
	CaseFormatLowerUnderscore CaseFormat = "lowerUnderscore"
	CaseFormatDash            CaseFormat = "dash"
	CaseFormatLowerDash       CaseFormat = "lowerdash"
	CaseFormatUpperDash       CaseFormat = "upperdash"
)

func DetectCaseFormat

func DetectCaseFormat(words ...string) CaseFormat

func NewCaseFormat

func NewCaseFormat(name string) CaseFormat

func (CaseFormat) Format added in v0.5.1

func (c CaseFormat) Format(text string, caseFormat CaseFormat) string

func (CaseFormat) Index

func (c CaseFormat) Index() int

func (CaseFormat) IsDefined

func (c CaseFormat) IsDefined() bool

IsDefined returns true if case format is defined

func (CaseFormat) To

type CaseFormatter

type CaseFormatter struct {
	// contains filtered or unexported fields
}

CaseFormatter defines words case formatter

func (*CaseFormatter) Format

func (c *CaseFormatter) Format(src string) string

Format converts source to desired case format

func (*CaseFormatter) To

func (c *CaseFormatter) To() CaseFormat

Jump to

Keyboard shortcuts

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