Documentation
¶
Overview ¶
Package fold implements the simple Unicode case-folding shared by the public github.com/gechr/x/strings and github.com/gechr/x/bytes packages. It sits below them so both fold identically - the same orbit canonicaliser and the same rune-scanning traversal - without duplicating that logic and without an import cycle.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Compare ¶
Compare compares `a` and `b` case-insensitively under simple case-folding and returns -1, 0, or 1 following the cmp.Compare convention. `Compare(a, b)` is 0 iff `a` and `b` are equal under strings.EqualFold/bytes.EqualFold.
func Contains ¶
Contains reports whether `s` contains `substr`, case-insensitively under simple case-folding.
func HasPrefix ¶
HasPrefix reports whether `s` begins with `prefix`, case-insensitively under simple case-folding.
func HasSuffix ¶
HasSuffix reports whether `s` ends with `suffix`, case-insensitively under simple case-folding.
func Rune ¶
Rune maps `r` to the canonical (smallest) member of its case-fold orbit, so two runes have equal keys iff they are equal under simple case-folding. unicode.ToLower alone misses orbit members with distinct lowercase forms, for example Greek final sigma 'ς' vs 'σ'.