Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
16
Task/String-case/Zig/string-case.zig
Normal file
16
Task/String-case/Zig/string-case.zig
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
const std = @import("std");
|
||||
|
||||
pub fn main() !void {
|
||||
const stdout_wr = std.io.getStdOut().writer();
|
||||
const string = "alphaBETA";
|
||||
var lower: [string.len]u8 = undefined;
|
||||
var upper: [string.len]u8 = undefined;
|
||||
for (string) |char, i| {
|
||||
lower[i] = std.ascii.toLower(char);
|
||||
upper[i] = std.ascii.toUpper(char);
|
||||
}
|
||||
try stdout_wr.print("lower: {s}\n", .{lower});
|
||||
try stdout_wr.print("upper: {s}\n", .{upper});
|
||||
|
||||
// TODO use https://github.com/jecolon/zigstr
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue