How to delete last line in a label

Godot Version

Godot 4.3

Question

So I have a label that will show messages when i pick up an item likes this:
You picked up “Item”
You picked up “Item”

What I want to know because I haven’t figured yet out is how to delete the last line of the label. I know you can delete the last character of label but I havent figured out how to apply the same but with a line.

Label.text is a string.

If you want to remove a line we need to find the lines by splitting the string.

var strings = Label.text.split('\n')
strings.remove_at(strings.size()-1)
Label.text = '\n'.join(strings)