fork download
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.util.*;
  4. import java.lang.*;
  5. import java.io.*;
  6.  
  7. /* Name of the class has to be "Main" only if the class is public. */
  8. class Ideone
  9. {
  10. public static void main (String[] args) throws java.lang.Exception
  11. {
  12. System.out.println(
  13.  
  14. .of( "Newcastle" , "H" )
  15. .stream()
  16. .anyMatch(
  17. .of(
  18. "17/08/2019;15:00;Norwich;Newcastle;3;1;H;S Attwell;1;3;0;0"
  19. .split( ";" ) // Returns an array of `String` objects.
  20. ) // Returns a `List` object.
  21. :: contains // Defines a method reference, to be passed as a `Predicate` object in our call to `Stream#anyMatch`.
  22. )
  23.  
  24. );
  25. }
  26. }
Success #stdin #stdout 0.08s 48276KB
stdin
Standard input is empty
stdout
true