Count Words

Count the number of whitespace-separated words in a string.

Code

General
str.split.length

Parameters

The string to count words in

Server

More Ruby Snippets