Skip to content

kablamo/perl-string-camelsnakekebab

Repository files navigation

Build Status Coverage Status

NAME

String::CamelSnakeKebab - word case conversion

SYNPOSIS

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"

word_split 'ASnakeSlithersSlyly'
# => ["A", "Snake", "Slithers", "Slyly"]

word_split 'flux-capacitor'
# => ["flux", "capacitor"]

DESCRIPTION

Camel-Snake-Kebab is a Clojure library for word case conversions. This library is ported from the original Clojure.

METHODS

lower_camel_case()

upper_camel_case()

lower_snake_case()

upper_snake_case()

constant_case()

kebab_case()

http_header_case()

word_split()

ERROR HANDLING

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.

SEE ALSO

The original Camel Snake Kebab Clojure library: https://github.com/qerub/camel-snake-kebab

AUTHOR

Eric Johnson (kablamo)

About

Case conversion library for camel case, snake case, etc. A Perl port of the Clojure library CamelSnakeKebab.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages