package
0.0.0-20230310201401-7aac46a7fa12
Repository: https://github.com/mitghi/protox.git
Documentation: pkg.go.dev

# README

strs

This package contains string utilities and algorithms. New MatchSplit(non-recursive) function is about 2x faster than recursive version.

Mike@/tmp:$ go test -bench=. t_test.go -cpuprofile=c.out
BenchmarkMatch-2         1000000              1144 ns/op
BenchmarkMatchNew-2      2000000             **607 ns/op**
PASS
ok      command-line-arguments  3.052s
Mike@/tmp:$

# Functions

FindPrefix finds longest common prefix between two strings and writes it to int pointer `pf`.
LCPWithSeparator is similar to `FindPrefix` but returns longest common prefix with evaluating wildcard positions.
Match returns wether two strings seperated by delimiter `spl` are exactly a match.
MatchSplits returns wether two strings seperated by delimiter `spl` are exactly a match.