I have a list like below,
ThreadsList-
Thread1-
Messages-
Message1
text="@"
Message2
text="hello"
Thread2-
Messages-
Message1
text="@"
Message2
text="hello"
Message3
text="hi"
I need to remove all messages inside each Thread that has the text "@"
I have tried the below code but it's not working as expected,
threadsList.filter { item ->
item.messages.any { !it.text.equals("@") }
}