xstrings

package
v0.0.0-...-8299741 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2024 License: GPL-3.0 Imports: 2 Imported by: 5

Documentation

Overview

Package xstrings provides addons to standard package strings.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HeadTail

func HeadTail(s, sep string) (head, tail string, err error)

HeadTail splits string into head & tail.

(head+sep+tail) -> head, tail.

Note: tail may contain sep.

func Split2

func Split2(s, sep string) (s1, s2 string, err error)

Split2 splits string by sep and expects exactly 2 parts.

func SplitLines

func SplitLines(s, sep string) []string

SplitLines splits string into lines.

The last line, if it is empty, is omitted from the result. (rationale is: string.Split("hello\nworld\n", "\n") -> ["hello", "world", ""])

Types

This section is empty.

Jump to

Keyboard shortcuts

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