- ERROR HANDLING
- SEE ALSO
String::CamelSnakeKebab - word case conversion
use String::CamelSnakeKebab qw/:all/; lower_camel_case 'flux-capacitor' # => 'fluxCapacitor upper_camel_case 'flux-capacitor' # => 'FluxCapacitor lower_snake_case 'ASnakeSlithersSlyly' # => 'a_snake_slithers_slyly' upper_snake_case 'ASnakeSlithersSlyly' # => 'A_Snake_Slithers_Slyly' constant_case "I am constant" # => "I_AM_CONSTANT" kebab_case 'Peppers_Meat_Pineapple' # => 'peppers-meat-pineapple' http_header_case "x-ssl-cipher" # => "X-SSL-Cipher"
Camel-Snake-Kebab is a Clojure library for word case conversions. This library is ported from the original Clojure.
Invalid input is usually indicated by returning the empty string. So you may want to check the return value. This happens if you pass in something crazy like "___" or "_-- _" or "". Because what does it mean to lower camel case "_-- _"? I don't know and I don't want to think about it any more.
The original Camel Snake Kebab Clojure library: https://github.com/qerub/camel-snake-kebab
Eric Johnson (kablamo)