Announcement

Collapse
No announcement yet.

escape double-square brackets

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • escape double-square brackets

    In the following array, one of the items (blue) has double-square brackets:
    Code:
    t = [[
    red
    orange
    [[blue]]
    pink
    green
    ]]
    
    print (t)
    How would I instruct Lua to escape those brackets in such an instance?

  • #2
    You can do this, which you might find very useful:

    Code:
    t = [=[
    red
    orange
    [[blue]]
    pink
    green
    ]=]
    
    print (t)
    You can even keep adding equal signs, however I'm not sure if 5.1 supports this too. I do believe so:
    Code:
    t = [=======[
    red
    orange
    [[blue]]
    pink
    green
    ]=======]
    
    print (t)
    Bas Groothedde
    Imagine Programming :: Blog

    AMS8 Plugins
    IMXLH Compiler

    Comment


    • #3
      Definitely useful to know.
      Thanks very much, IP.

      Comment

      Working...
      X