Zig-vars: expand variables in strings
Ziggit
Zig-vars: expand variables in strings
https://codeberg.org/roble/zig-vars/ I searched the docs and online for 10 seconds and didn’t find a way to expand environment variables in a string… so I made my own library! 😅 I wanted this functionality for some other project I’m working on, but I figured variable expansion would be pretty reusable in other projects too. const expanded = try vars.expandEnv(init.gpa, init.environ_map, "Hello, ${HOME}!"); defer init.gpa.free(expanded); std.debug.print("{s}\n", .{expanded}); // pr...
0 comments
No comments yet.