pub fn trim(comptime T: type, slice: []const T, values_to_strip: []const T) []const T T: typeslice: []const Tvalues_to_strip: []const T1224
1225
1226
1227
1228
1229
1230pub fn trim(comptime T: type, slice: []const T, values_to_strip: []const T) []const T {
var begin: usize = 0;
var end: usize = slice.len;
while (begin < end and findScalar(T, values_to_strip, slice[begin]) != null) : (begin += 1) {}
while (end > begin and findScalar(T, values_to_strip, slice[end - 1]) != null) : (end -= 1) {}
return slice[begin..end];
}
Remove a set of values from the beginning and end of a slice.