text

package
v0.0.0-...-2e1bc12 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2024 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractLines

func ExtractLines(text string, start, end int) string

ExtractLines extract the given lines (1-based indices).

func IsBlank

func IsBlank(text string) bool

IsBlank returns if a text is blank.

func IsNumber

func IsNumber(text string) bool

IsNumber returns if a text is a number.

func LineNumber

func LineNumber(text string, sub string) int

LineNumber returns the number of the first line containing the subtring or -1 if not found.

func PrefixLines

func PrefixLines(text string, prefix string) string

PrefixLines add a prefix to every line. All lines ends with \n in the result.

func Repeat

func Repeat(text string, n int) string

Repeat repeats the same text the given number of times.

func SquashBlankLines

func SquashBlankLines(text string) string

SquashBlankLines replaces successive blank lines by a single empty one.

func StripHTMLComments

func StripHTMLComments(text string) string

StripHTMLComments remove HTML single and multiline comments from a document.

func ToBookTitle

func ToBookTitle(text string) string

ToBookTitle transform a title to follow common book title conventions (there are many conventions so no one is used in particular)

func TrimExtension

func TrimExtension(path string) string

TrimExtension removes the extension from a file name or file path.

func TrimLinePrefix

func TrimLinePrefix(text string, prefix string) string

TrimLinePrefix removes the prefix from every line

Types

This section is empty.

Jump to

Keyboard shortcuts

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