Function chopSlice [src]
Prototype
pub fn chopSlice(ptr: []const u8, offset: u64, size: u64) error{Overflow}![]const u8
Parameters
ptr: []const u8
offset: u64
size: u64
Possible Errors
Source
pub fn chopSlice(ptr: []const u8, offset: u64, size: u64) error{Overflow}![]const u8 {
const start = cast(usize, offset) orelse return error.Overflow;
const end = start + (cast(usize, size) orelse return error.Overflow);
return ptr[start..end];
}