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.


Package Files


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 2020-08-05. Refresh now. Tools for package owners.