Skip to content

Instantly share code, notes, and snippets.

@Headmast
Created September 30, 2020 20:12
Show Gist options
  • Save Headmast/968804172fa1f8d04459d6a4ac3473a8 to your computer and use it in GitHub Desktop.
Save Headmast/968804172fa1f8d04459d6a4ac3473a8 to your computer and use it in GitHub Desktop.
void main() {
  //a
  Set mySet = {'Москва', 'Вашингтон', 'Париж'};
  mySet.add('Вашингтон');
  //b
  print('MySet length ${mySet.length}');
  // In set we can add only unique element.
  
  //c
  String 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 she sells seashore shells.
  """;
  var formatText = text.trim().replaceAll("\n", "");
  var word = formatText.split(' ');
  print('Word count: ${word.length}');
}
@artem-zaitsev
Copy link

Все отлично

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment