class String
Public Instance Methods
Source
# File lib/gamefic/core_ext/string.rb, line 8 def capitalize_first "#{self[0, 1].upcase}#{self[1, length]}" end
Capitalize the first letter without changing the rest of the string. (String#capitalize makes the rest of the string lower-case.)
@return [String] The capitalized text
Also aliased as: cap_first
Source
# File lib/gamefic/core_ext/string.rb, line 16 def keywords gsub(/[\s-]+/, ' ').strip.downcase.split end
Get an array of words split by any whitespace.
@return [Array<String>]
Source
# File lib/gamefic/core_ext/string.rb, line 21 def normalize keywords.join(' ') end
@return [String]