Skip to content

Instantly share code, notes, and snippets.

@deHelden
Created January 5, 2019 12:07
Show Gist options
  • Save deHelden/3ee7b3caecdff141f7d516f73df54128 to your computer and use it in GitHub Desktop.
Save deHelden/3ee7b3caecdff141f7d516f73df54128 to your computer and use it in GitHub Desktop.
[Task 8] Count words in a string
# 8) Дана строка в которой записаны слова через пробел. Необходимо посчитать
# количество слов.
def word_counter
string = "alskdfj asd;lfjk asdkfj;lasd flaskdj f as;dlfjk a;sd fkla sdf;"
string.split.size
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment