Created
March 5, 2021 23:39
-
-
Save rodion-m/52c46939966aa9a2b4bff82ec31c6186 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void main() { | |
const text = """She sells sea shells on the sea shore; | |
The shells that she sells are sea shells I'm sure. | |
So if she sells sea shells on the sea shore, | |
I'm sure that the shells are sea shore shells"""; | |
var list = text.split(" "); | |
var wordsCount = list.length; | |
var uniqWordsCount = list.toSet().length; | |
print("Всего слов в тексте: ${wordsCount}"); | |
print("Уникальных слов в тексте: ${uniqWordsCount}"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment