tailscale/util/slicesx
Nick Khyl d500a92926 util/slicesx: add HasPrefix, HasSuffix, CutPrefix, and CutSuffix functions
The standard library includes these for strings and byte slices,
but it lacks similar functions for generic slices of comparable types.
Although they are not as commonly used, these functions are useful
in scenarios such as working with field index sequences (i.e., []int)
via reflection.

Updates #12687

Signed-off-by: Nick Khyl <nickk@tailscale.com>
2024-07-22 11:03:46 -05:00
..
slicesx.go util/slicesx: add HasPrefix, HasSuffix, CutPrefix, and CutSuffix functions 2024-07-22 11:03:46 -05:00
slicesx_test.go util/slicesx: add HasPrefix, HasSuffix, CutPrefix, and CutSuffix functions 2024-07-22 11:03:46 -05:00