Log In  

Cart #knutil_msplit-1 | 2023-05-22 | Code ▽ | Embed ▽ | No License

Feature Overview

MSPLIT() Converts a string into a table by splitting it with multiple delimiters.

  • The default delimiter is " " for ease of data entry and readability(according to one's own preference).
  • the default delimiters and numeric conversion flags should be modified according to your project.
  • This function consumes 36 Token.
-- Split a pair of data and further split it into colors and names.

local value=msplit(
     '10-yellow 11-green 8-red 12-blue'
     ,' ','-'

for i,v in pairs(value) do

    local col,name=unpack(v)


If you want to check the type at once, consider using a DMP().
This function is included in the KNUTIL library.

release note


  • first release
P#130014 2023-05-22 08:40 ( Edited 2023-05-22 08:41)

[Please log in to post a comment]