Modifying an array parameter

After completing Ziglings I decided to move on to the Zig exercises on Exercism. The raindrop exercise has the following function template:

pub fn convert(buffer: []u8, n: u32) []const u8 {
    _ = buffer;
    _ = n;
    @compileError("please implement the convert function");
}

I’m looking for documentation or an example function showing how to modify an array passed as a function parameter.

Pass a pointer (slice) to the array as parameter and dereference it in the function body.

This is not an array. It is a slice. An array would specify the length: array: [42]u8. You can modify the array referenced by the slice: buffer[69] = 'A'. Then you return a new slice: return buffer[0..new_length].