Sha256: 85aaf7d411c4b4deb5e0e85e60591edf404bcb9d38b4ba02507e8e3b3574d914

Contents?: true

Size: 444 Bytes

Versions: 1

Compression:

Stored size: 444 Bytes

Contents

require "string_plus/version"

module StringPlus
  def camelcase(capitalize_first_char=true)
    res = ""
    flag = capitalize_first_char
    self.each_char {|w|
      (flag = true ; next) if w == "_" || w == " "
      res << if flag
               flag = false
               w.upcase
             else
               w
             end
    }
    res
  end

  def lcamelcase
    camelcase(false)
  end

end

String.send(:include, StringPlus)

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
string_plus-0.2.0 lib/string_plus.rb