Skip to content
Advertisement

java lambda allmatch print value if not match

Having a list of strings, if a string not start with a prefix, I would like to print it. The result will be a boolean, if all strings start with the prefix.

Is there a way to do it in one row?

What is the correct syntax to combined this too :

JavaScript

Thanks,

Advertisement

Answer

Use Stream.peek to place an operation in the middle of the stream

JavaScript
User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement