mirror of
https://codeberg.org/andyscott/exercism.git
synced 2024-12-22 14:43:10 -05:00
9 lines
205 B
Zig
9 lines
205 B
Zig
|
const std = @import("std");
|
||
|
|
||
|
/// Writes a reversed copy of `s` to `buffer`.
|
||
|
pub fn reverse(buffer: []u8, s: []const u8) []u8 {
|
||
|
@memcpy(buffer, s);
|
||
|
std.mem.reverse(u8, buffer);
|
||
|
return buffer;
|
||
|
}
|