ubermanu / case.zig

Convert ASCII string to a different case

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

case.zig

A set of functions to change the case of a string.

Install

zig fetch --save git+https://github.com/ubermanu/case.zig
const case_mod = b.dependency("case", .{});
exe.root_module.addImport("case", case_mod.module("case"));

Usage

const case = @import("case");

test {
    const allocator = std.testing.allocator;

    const str = try case.toPascalCase(allocator, "Some string");
    defer allocator.free(str);

    try std.testing.expectEqualStrings("SomeString", str);
}

About

Convert ASCII string to a different case

License:MIT License


Languages

Language:Zig 100.0%