Jump to content

How to appropriate [[ ]]


ilnaz

Recommended Posts

  • Moderators
13 minutes ago, ilnaz said:

local text = [[text]]

how insert in this "text" other words?

Insert as in adding more words?

local text = [[text]]

text = text .. " is something ..."

 

Your are using a multiline format, but it doesn't change the fact that it is still a string.

The only difference about it, is that it automatic adds newlines. (and maybe some other stuff that I do not know about)

 

local text1 = "text\ntext"

print(text1)

local text2 = [[text
text]]

print(text2)

 

 

Edited by IIYAMA
Link to comment
  • Moderators
2 hours ago, ilnaz said:

i use [[ ]] for replace symbol "\" in text 'example\example'

That doesn't sounds right. Multi-line strings do generate "\n", for each new line, not just "\".

What do you want to achieve?

 

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...