Error in manual for 'split' command

new topic     » topic index » view thread      » older message » newer message

The manual entry for the 'split' command seems to have parameter 4 described as out by one.

Paramater 4 for this command says "limit : an integer (default is 0). The maximum number of sub-sequences to create. If zero, there is no limit."

The example given is:

result = split("John,Middle,Doe", ",",, 2) -- Only want 2 sub-sequences. 
-- result is {"John", "Middle,Doe"} 

That example actually gives:

-- result is {"John",  "Middle", "Doe"} 

To get the desired result we would need to code:

result = split("John,Middle,Doe", ",",, 1) 
-- result is { "John", "Middle,Doe"} 
new topic     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu