save parts of text in new var or array

Hi, 

i’m new in corona SDK, and I have one problem.

When I do one network listener, I have one var with this text: (example)

“<p>XXX XXXX XXX</p><p>XXX XXXX XXX</p><p>XXX XXXX XXX</p><p>XXX XXXX XXX</p><p>XXX XXXX XXX</p><p>XXX XXXX XXX</p><p>XXX XXXX XXX</p><p>XXX XXXX XXX</p><p>XXX XXXX XXX</p><p>XXX XXXX XXX</p>”

Can I cut and save in others var, or maybe in a array, like this:

var[1] = XXX XXXX XXX

var[2] = XXX XXXX XXX

var[3] = XXX XXXX XXX

var[4] = XXX XXXX XXX

Thx!!

That looks like you’re getting HTML back from the server. HTML is XML and you can use an XML parser.  There is an xml.lua file in our Business App Sample that you probably could use for this:

https://github.com/coronalabs-samples/business-app-sample

You pass it the response and it should return you a table of strings that you can loop over and copy to your table.

Rob

That looks like you’re getting HTML back from the server. HTML is XML and you can use an XML parser.  There is an xml.lua file in our Business App Sample that you probably could use for this:

https://github.com/coronalabs-samples/business-app-sample

You pass it the response and it should return you a table of strings that you can loop over and copy to your table.

Rob