Announcement

Collapse
No announcement yet.

[important] is there any way to convert text lines from string to table ?

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

  • [important] is there any way to convert text lines from string to table ?

    Hi all ✋, is there any way to convert text lines from string to table ?

  • #2
    Code:
    local my_string = [[Hello, you can split up this string to a 
    table and add each line with contents to all_lines. 
    This means that empty lines 
    
    will
    
    be
    
    
    
    ignored.]];
    
    
    local all_lines = {};
    
    for line in my_string:gmatch("[^\r\n]+") do
        all_lines[#all_lines + 1] = line;
        
        Dialog.Message("testing", line);
    end
    Bas Groothedde
    Imagine Programming :: Blog

    AMS8 Plugins
    IMXLH Compiler

    Comment


    • #3
      Originally posted by Imagine Programming View Post
      Code:
      local my_string = [[Hello, you can split up this string to a
      table and add each line with contents to all_lines.
      This means that empty lines
      
      will
      
      be
      
      
      
      ignored.]];
      
      
      local all_lines = {};
      
      for line in my_string:gmatch("[^\r\n]+") do
      all_lines[#all_lines + 1] = line;
      
      Dialog.Message("testing", line);
      end
      Thank you so much 😍☺😊

      Comment

      Working...
      X