#Splitting strings accross multiple lines

1 messages · Page 1 of 1 (latest)

steep rune
#

Is there a way that I can write a really long string accross multiple lines without using actualling inserting a new line into the string?

bright vessel
#

Are you looking for multiline string literals?

const hello_world_in_c =
    \\#include <stdio.h>
    \\
    \\int main(int argc, char **argv) {
    \\    printf("hello world\n");
    \\    return 0;
    \\}
;
#

Or do you want the opposite, a string on multiple lines without new lines in the result

lapis otter
#

you can ++ multiple strings

#
const str = "some super long string" ++
    "an even longer one";
steep rune
#

k