Skip to content

Commit

Permalink
add word starts with only w words
Browse files Browse the repository at this point in the history
  • Loading branch information
bagouser123 committed Oct 22, 2023
1 parent 0a55a89 commit 07e8750
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main/java/core/basesyntax/FileWork.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public String[] readFromFile(String fileName) {
StringBuilder content = new StringBuilder();
String line;

while ((line = reader.readLine()) != null){
while ((line = reader.readLine()) != null) {
content.append(line).append(" ");
}
reader.close();
Expand All @@ -25,7 +25,7 @@ public String[] readFromFile(String fileName) {
Matcher matcher = pattern.matcher(text);

HashSet<String> filteredWords = new HashSet<>();
while(matcher.find()) {
while (matcher.find()) {
String word = matcher.group();
if (word.startsWith("w")) {
filteredWords.add(word);
Expand Down

0 comments on commit 07e8750

Please sign in to comment.