singularize(word) public

The reverse of pluralize, returns the singular form of a word in a string.

Examples:

"posts".singularize            # => "post"
"octopi".singularize           # => "octopus"
"sheep".singularize            # => "sheep"
"word".singularize             # => "word"
"CamelOctopi".singularize      # => "CamelOctopus"
Show source
Register or log in to add new notes.