Agreed. I’ll repost what I posted there so we can chew this around here. Thanks much once again.
For some reason the string.match did not work well with my data. It might have even been a copy/paste from the blog. I know sometimes some characters get messed up when you copy/paste from the blog.
Anyways, playing with your idea, I used a slightly less refined way of getting the same result. Sharing below. Not sure why string.match is not working well but this approach is. Will poke around some more to understand this better.
Also note I’m looking for “\r\n” to avoid one extra line inserted in between my paragraphs. In other words, when I looked for \n to define paragraphs I ended up with extra lines in between my actual paragraphs. Changing from “\n” to “\r\n” helped solve that problem.
repeat local b, e = string.find(tmpString, "\r\n") if b then print(b .. " " .. e) paragraph = string.sub(tmpString, 1, b-1) tmpString = string.sub(tmpString, e+1) else paragraph = tmpString tmpString = "" end options.text = paragraph paragraphs[#paragraphs+1] = display.newText( options ) paragraphs[#paragraphs].anchorX = 0 paragraphs[#paragraphs].anchorY = 0 paragraphs[#paragraphs].x = 10 paragraphs[#paragraphs].y = yOffset paragraphs[#paragraphs]:setFillColor( 0 ) scrollView:insert( paragraphs[#paragraphs] ) yOffset = yOffset + paragraphs[#paragraphs].height print( #paragraphs, paragraph ) until tmpString == nil or string.len( tmpString ) == 0