1

I need to skip elements up to "round". I can do this by specifying offset:

Stream<String> s = Stream.of( "gangland", "horror", "hand", "round", "suave", "paradise");
List<String> result = s.skip(3).collect(Collectors.toList());

But in real life I don't know the position of this elemnt. Is there a way to skip everything up to predefined value?

Tunaki
  • 132,869
  • 46
  • 340
  • 423
Anthony
  • 12,407
  • 12
  • 64
  • 88

0 Answers0