Last active
October 13, 2023 01:35
-
-
Save MadLittleMods/f6682f4472d621142d608bfdf40eb6e1 to your computer and use it in GitHub Desktop.
Break-up long string across multiple lines in Zig (combine strings)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const std = @import("std"); | |
// See "a ++ b" in the Zig docs: https://ziglang.org/documentation/master/#Operators | |
pub fn main() void { | |
std.log.debug( | |
"We can split up a really long string across multiple lines in Zig using " ++ | |
"the ++ operator which works on comptime known arrays. Since comptime " ++ | |
"strings look like `[100:0]const u8` indicating a null terminated array of " ++ | |
"integers that is 100 characters long, this works just fine.", | |
.{}, | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment