pub fn cutSuffix(comptime T: type, slice: []const T, suffix: []const T) ?[]const T T: typeslice: []const Tsuffix: []const T3239
3240
3241pub fn cutSuffix(comptime T: type, slice: []const T, suffix: []const T) ?[]const T {
return if (endsWith(T, slice, suffix)) slice[0 .. slice.len - suffix.len] else null;
}
If
sliceends withsuffix, returnsslicefrom beginning to start ofsuffix.