Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Wanted: Help translating From C# lambdas to Java 8 lambdas to Implement function GetPermutations  RSS feed

Siegfried Heintze
Ranch Hand
Posts: 417
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I need to find all the permutations of a set of strings.
I did a google search for java and found some examples that seem to work:

However, I found this cool C# code (below) that used lambdas to do the job in much less code! Now that Java 8 has lambdas, is there a nicer compact way to code this in Java 8 similar to the approach taken by C# below?
It seems to me we should have some java counterpart to the selectMany function that would accept some lambdas to implement a filter like C# does.


It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!