Wow. That was fast. Thanks for sharing this useful function.
I was just about to share the following which is what I managed to come up in the same time. I was going to say here are the string functions you need. Put it into some form of recursive loop and you’ll get what you need but then Renato happened!!! I am humbled!
local jsonLine = "LINE 1\n|Line 2 will be a long line of text.\n\n|LINE 3\n|Line 4 is another line of text that will appear here." local parsedStrings = {} local separatorLocation = string.find(jsonLine,"|" ) -- now we know where the first separator is print(separatorLocation) parsedStrings[1] = string.sub(jsonLine, 1, (separatorLocation - 1)) print(parsedStrings[1]) local jsonLineLength = string.len(jsonLine) jsonLine = string.sub(jsonLine, (separatorLocation + 1), jsonLineLength) print(jsonLine)