I want to count the small letter alphabets present in a string. Say I have:
a = "SaMarMiShrA"
Since you want to be able to do "whatever".count_small_letters you would have to monkey patch String so
class String def count_small_letters #any of @Зелёный suggestions or scan(/[a-z]/).count end end
> " SaMarMiShrA".count_small_letters > 6