xbytes

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2024 License: MPL-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package xbytes provides additional iterator functions for working with bytes slices. Functions from this package will become a part of the Go standard library in Go 1.24, when this package functions will be deprecated and eventually removed.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Lines

func Lines(s []byte) iter.Seq[[]byte]

Lines returns an iterator over the newline-terminated lines in the byte slice s. The lines yielded by the iterator include their terminating newlines. If s is empty, the iterator yields no lines at all. If s does not end in a newline, the final yielded line will not end in a newline. It returns a single-use iterator.

func SplitAfterSeq

func SplitAfterSeq(s, sep []byte) iter.Seq[[]byte]

SplitAfterSeq returns an iterator over substrings of s split after each instance of sep. The iterator yields the same strings that would be returned by SplitAfter(s, sep), but without constructing the slice. It returns a single-use iterator.

func SplitSeq

func SplitSeq(s, sep []byte) iter.Seq[[]byte]

SplitSeq returns an iterator over all substrings of s separated by sep. The iterator yields the same strings that would be returned by Split(s, sep), but without constructing the slice. It returns a single-use iterator.

Types

This section is empty.

Jump to

Keyboard shortcuts

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