Convert to camelCase

Convert a string to camelCase format with lowercase first letter.

Code

General
words = str.split(/[\s_-]+/)
return words[0].downcase + words[1..].map(&:capitalize).join

Parameters

The string to convert

Server

More Ruby Snippets