Method: String#capitalized?

Defined in:
lib/core/facets/string/capitalized.rb

#capitalized?Boolean

Return true if the string is capitalized, otherwise false.

"This".capitalized?  #=> true
"THIS".capitalized?  #=> false
"this".capitalized?  #=> false

Note Ruby’s strange concept of capitalized. See capitalcase for the more command conception.

CREDIT: Phil Tomson

Returns:

  • (Boolean)


14
15
16
# File 'lib/core/facets/string/capitalized.rb', line 14

def capitalized?
  capitalize == self
end