lib/lite/ruby/string.rb in lite-ruby-1.0.0 vs lib/lite/ruby/string.rb in lite-ruby-1.0.1
- old
+ new
@@ -30,9 +30,17 @@
'Ū' => 'U', 'ū' => 'u', 'Ŭ' => 'U', 'ŭ' => 'u', 'Ů' => 'U', 'ů' => 'u', 'Ű' => 'U',
'ű' => 'u', 'Ų' => 'U', 'ų' => 'u', 'Ŵ' => 'W', 'ŵ' => 'w', 'Ŷ' => 'Y', 'ŷ' => 'y',
'Ÿ' => 'Y', 'Ź' => 'Z', 'ź' => 'z', 'Ż' => 'Z', 'ż' => 'z', 'Ž' => 'Z', 'ž' => 'z'
}.freeze
+ def acronym
+ gsub(/(([a-zA-Z0-9])([a-zA-Z0-9])*)./, '\\2')
+ end
+
+ def acronym!
+ replace(acronym)
+ end
+
def any?(*keys)
keys.any? { |key| include?(key) }
end
def at(position)