Skip to content

Instantly share code, notes, and snippets.

@mikalai-yankouski
Last active November 27, 2018 13:00
Show Gist options
  • Save mikalai-yankouski/949b212ec13cb5823c83ef01ca0983ee to your computer and use it in GitHub Desktop.
Save mikalai-yankouski/949b212ec13cb5823c83ef01ca0983ee to your computer and use it in GitHub Desktop.
Дана строка в которой записаны слова через пробел. Необходимо посчитать количество слов.
random_string = Faker::Lorem.words(10).join(" ")
words = random_string.split.count
puts "String: #{random_string.inspect}"
puts "Words in string: #{words}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment