predstrings

package
v0.0.0-...-83fde48 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2026 License: BSD-2-Clause Imports: 6 Imported by: 0

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