Skip to content

Commit da1e507

Browse files
author
Sarah Akinkunmi
committed
update
1 parent 5c462ac commit da1e507

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/chapter14/TextAnalysis.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ public static void wordsGroupedByCharacterLength() {
8989
public static void sameWordOccurrence() {
9090
System.out.println("Enter a text:");
9191
String text = scanner.nextLine().replaceAll("[^a-zA-Z0-9']", " ").toLowerCase();
92-
text = text.replaceAll(" ", " ");
92+
text = text.replaceAll(" {2}", " ");
9393
System.out.printf("%s%35s%n", "Words", "Occurrences");
9494

9595
String[] tokens = text.split("\\s");
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
package chapter14;public class WordEquivalentOfCheckAmount {
2+
}

0 commit comments

Comments
 (0)