Hi people I wanted to know because I work on a custom statut description script
and I wanted to know in script how I can for a string to be split in a new line ?
like exemple
Description = {"Leandre" => "young girl of 18 years old. " # split a new line"she the only sister of ralph."}sadly I don't know how to make this :/
I hope someone will be able to help me out
I think adding \n into the string would work. \ is the escape character and will denote an alternative mark together with the next one. So \n together means new line. 🙂
In string it looks like this: "Hello\nWorld"
When ptogram prints it out:
"Hello
World"
hum yes seem really ligit but I don't know if this read in the same way in script D:
but thanks I will try out haha
It should work. It works at least in html, python and R 😉 The new line is actually a part of the string itself and considered a character.
Or do you want to format the code to be in shorter lines for easy reading? Then it is a bit different.
If you want them in separate lines in code, but no line break in print out:
"Hello "\
"World" will work in the code same way as "Hello World", so you can make long strings easy to read in code with that.
this work for not show the code line but sadly this not cut the text and not make a new line :/
Which did you try? You can also use both in the same place as follows:
"Hello\n"\
"World"
The \n in the string adds the line break in the text and the \ will help you break the code in two lines.
oh I only tested \n this explain why this will not work!
No problem, I edited that into my post a bit later! Glad if it now works fine 🙂