That in the first post is a copy and paste from the logging pane. I have logged both arrays to debug logging and compared. They are identical in case without any control characters.
I spent hours trying and carefully comparing. Has anyone else got this removeAll method working in ST? It just doesn’t work in multiple tests and I performed.
Do both lists contain elements of the same type? Wondering if it could look like a string but really be an object in there and you’re just seeing the toString() in the logs.
If in a SmartApp the following code doesn’t result in [bar], then we can say there’s a problem with the SmartThings Groovy:
Thanks for your help…i do feel a bit sheepish now. I was convinced I got the first array by calling the object.name in my code, however you were correct that I was just calling the object when I checked after reading your post.
Cheers for that as I could not see the wood for the trees
Yeah, one of the benefits of dynamic languages is you don’t have to litter your code with typing information… but the downside is that types still matter, and it’s not always clear what type your dealing with