predstrings

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2026 License: BSD-2-Clause Imports: 6 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package predstrings provides predicates on strings, derived from curried stdlib string functions.

Index

Constants

This section is empty.

Variables

View Source
var (
	// LastIndexOf returns a function that reports the index of the
	// last occurrence of substr in s (-1 if absent).
	LastIndexOf = F.Bind2of2(strings.LastIndex)

	// HasSuffix returns a function that reports whether s ends with suffix.
	HasSuffix = F.Bind2of2(strings.HasSuffix)

	// ContainsRuneClass returns a function that reports whether s
	// contains any rune satisfying pred.
	ContainsRuneClass = F.Bind2of2(strings.ContainsFunc)

	// HasAtSign returns true when "@" exists anywhere in the string
	// (last index >= 0).
	HasAtSign = F.Pipe2(
		0,
		ORD.Geq(predord.IntOrd),
		Pred.ContraMap(LastIndexOf("@")),
	)
)

Functions

func StrLenBetween

func StrLenBetween(first, second int) Pred.Predicate[string]

StrLenBetween returns a Predicate that is true when len(s) is between first and second (inclusive).

Types

This section is empty.

Jump to

Keyboard shortcuts

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