(no title)
2WSSd-JzVM | 3 months ago
var input = "Some kind of string.";
var output = Optional.of(input)
.map(i -> i.trim())
.map(i -> i.replace(' ', '-'))
.map(i -> i.replaceAll("[./…]", ""))
.map(i -> i.toLowerCase())
.get();
That is until you realize there is no reason to go weird with arrow operators when String is an object: var input = "Some kind of string.";
var output = input.trim()
.replace(' ', '-')
.replaceAll("[./…]", "")
.toLowerCase();
It looks like they solved the wrong issue but that is probably just side effect of using trivial examples.
No comments yet.