In an app I'm making, text is displayed using a label, and each new entry is added below the last by joining the pre-existing label text with "\n" and then the new text. I want to be able to only show the most recent 18 entries, and delete the oldest entry as the 18th comes in. I tried the method I came up with, but it was deleting the most recent entry instead of the oldest one. I was splitting the text into a list just for the purpose of detecting when the entries were above 18, then using a segment to extract text after the first line break.
This is the code:
you could first convert the list into a csv row using the list to csv row block and after that use the replace all block from the text drawer to replace , by \n (assuming there are no commas inside the list items itself...)