go123: lab.nexedi.com/kirr/go123/xstrings Index | Files

package xstrings

import "lab.nexedi.com/kirr/go123/xstrings"

Package xstrings provides addons to standard package strings.

Index

Package Files

xstrings.go

func HeadTail Uses

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 Uses

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

Split2 splits string by sep and expects exactly 2 parts.

func SplitLines Uses

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", ""])

Package xstrings imports 2 packages (graph) and is imported by 2 packages. Updated 2019-08-12. Refresh now. Tools for package owners.