Skip to main content
Progzoo.net
Tutorials
Guides
Edit
Java
C#
C++
Perl
PHP
Python
Ruby
VB
Hide Sidebar
Show Sidebar
<Progzoo Sections>
ProgZoo
Tutorials
How to...
Assessments
Help
<Other>
To do list
Recent changes
Random page
Personal
Log in / create account
Views
Article
Discussion
View source
History
Toolbox
What links here
Related changes
Upload file
Special pages
Printable version
Checking for a Substring
From Progzoo
Simple Tests
Equal Strings
Equal Numbers
Comparing Numbers
Checking for a Substring
AND of two Conditions
OR of two Conditions
NOT of a Condition
Checking for a Prefix
Checking for a Suffix
We use the method
Contains
The code selects those countries that have a double "o".
.
static void oneLine(String name, String region, int area, long pop, long gdp) { if (name.contains("oo")) { System.out.printf("%s %s %d %d %d\n", name,region,area,pop,gdp); } }
[
Font
] [
Default
] [
Show
] [
Resize
] [
History
] [
Profile
]
test text