DD
Size: a a a
DD
DD
QH
DD
S
GV
S
S
S
LS
GV
String test = "one text two text three text";
String word = "text";
long count = Arrays.stream(test.split("\\s+"))
.filter(s -> s.equals(word))
.count();
System.out.println(count);
S
S
String test = "one text two text three text";
String word = "text";
long count = Arrays.stream(test.split("\\s+"))
.filter(s -> s.equals(word))
.count();
System.out.println(count);
S
AL
S
GV
AL
GV
S