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
  • 125,519
  • 44
  • 317
  • 399
Antonio
  • 11,629
  • 11
  • 60
  • 88

0 Answers0