@main def main(): Unit = val text = "the quick brown fox" // split on runs of whitespace, then count val n = text.split("\\s+").length println(n)
split on whitespace and count