June 2018
Beginner
722 pages
18h 47m
English
The method boolean contains(CharSequence s) returns true when the provided sequence of characters (substring) is present:
String s = "Introduction";System.out.println(s.contains("x")); //prints: falseSystem.out.println(s.contains("o")); //prints: trueSystem.out.println(s.contains("tro")); //prints: trueSystem.out.println(s.contains("trx")); //prints: false
Other similar methods are:
Read now
Unlock full access