strings

package
v2.25.0 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2025 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func JoinWithConjunction

func JoinWithConjunction(s []string) string

JoinWithConjunction joins a slice of strings with commas except for the last two which are joined with "and".

func Truncate added in v2.5.0

func Truncate(s string, n int) string

Truncate returns the first n characters of s.

func UISanitize added in v2.25.0

func UISanitize(in string) string

UISanitize sanitizes a string for display in the UI. The following transformations are applied, in order: - HTML tags are removed using bluemonday's strict policy. - ANSI escape codes are stripped using stripansi. - Consecutive backslashes are replaced with a single backslash. - Non-printable characters are removed. - Whitespace characters are replaced with spaces. - Multiple spaces are collapsed into a single space. - Leading and trailing whitespace is trimmed.

Types

This section is empty.

Jump to

Keyboard shortcuts

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