#Invalid escape character: 'e'

1 messages · Page 1 of 1 (latest)

mint trail
#

\e isn't a Zig escape code. use \x1b instead

tribal wren
#

I will try

#

Now I got an error saying

   const formated = bl + str + bl;
                    ~~~^~~~~```
mint trail
#

yup: you cannot concatenate strings in Zig - though it's reasonable in higher-level languages, that's not the case in Zig.

tribal wren
#

Oh

#

so what should i do

#

Put them togheter in the .{} ?

#

Like {} {} {}

mint trail
#

just print them in sequence:

pub fn white(str: []const u8) void {
   const wht = "\x1B[0;90m";
   std.debug.print("{s}{s}{s}", .{wht, formated, wht});
}
mint trail
tribal wren
#

alr

#

thanks