Skip to content
Advertisement

Java. Best way to split each element of List

How can I optimize this using streams ?

JavaScript

Advertisement

Answer

split returns the initial string if the delimiter is not found, so there is no need to test for “.” before performing the split:

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