6 karma · joined Nov 20, 2025 (1y ago) · 6 submissions
comment 1y ago · link · parent
comment 1y ago · link · parent
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.