Skip to content

Commit d340c06

Browse files
authored
Create StringLines.java
1 parent eb1bf57 commit d340c06

1 file changed

Lines changed: 33 additions & 0 deletions

File tree

strings/StringLines.java

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
package com.zetcode;
2+
3+
public class StringLines {
4+
5+
public static void main(String[] args) {
6+
7+
var words = """
8+
club
9+
sky
10+
blue
11+
cup
12+
coin
13+
new
14+
cent
15+
owl
16+
falcon
17+
brave
18+
war
19+
ice
20+
paint
21+
water
22+
""";
23+
24+
var wstream = words.lines();
25+
26+
wstream.forEach(word -> {
27+
28+
if (word.length() == 3) {
29+
System.out.println(word);
30+
}
31+
});
32+
}
33+
}

0 commit comments

Comments
 (0)