xstrings

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: May 7, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package xstrings provides convenience string functions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CutWhitespace added in v0.6.0

func CutWhitespace(s string) (before, after string, found bool)

CutWhitespace slices s around the first (white) space, returning the text before and after it. The found result reports whether a white space appears in s. If the white space does not appear in s, the function returns (s, "", false).

White space is determined using utf8.IsSpace and any character with Unicode's White Space property.

func JoinSpaced

func JoinSpaced(s string, more ...string) string

JoinSpaced the passed strings, ensuring they are properly separated by only a single space between each adjacent non-empty string, skipping empty strings.

Types

This section is empty.

Jump to

Keyboard shortcuts

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