You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
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>
3 months ago
..
slicesx.go util/slicesx: add HasPrefix, HasSuffix, CutPrefix, and CutSuffix functions 3 months ago
slicesx_test.go util/slicesx: add HasPrefix, HasSuffix, CutPrefix, and CutSuffix functions 3 months ago