Camel case and snake case: Difference between revisions

→‎{{header|Quackery}}: bug fix and tidy up
(Added Quackery)
(→‎{{header|Quackery}}: bug fix and tidy up)
Line 1,198:
[ dup lower != ] is capital ( c --> b )
 
[ $2 ""times false[ rotreverse trim ]
$ "" false rot
witheach
[ dup separator iff
Line 1,218 ⟶ 1,219:
{{out}}
Testing in the shell.
<pre>/O> ' [ $ "snakeCase"
... $ "snake_case"
... $ "variable_10_case"
... $ "variable10Case"
... $ "ergo rE tHis"
... $ "hurry-up-joe!"
... $ "c://my-docs/happy_Flag-Day/12.doc"
... $ " spaces " ]
... dup
... say "To camelCase:" cr cr
... witheach [ do camelise say " " echo$ cr ] cr
... cr
... say "To snake_case:" cr cr
... witheach [ do snakify say " " echo$ cr ] cr
...
To camelCase:
snakeCase
 
snakeCase
variable10Case
snakeCase
variable10Case
ergoRETHis
variable10Case
hurryUpJoe!
ergoRETHis
c://myDocs/happyFlagDay/12.doc
hurryUpJoe!
spaces
c://myDocs/happyFlagDay/12.doc
Spaces
 
To snake_case:
snake_case
 
snake_case
variable10_case
snake_case
variable10_case
ergo_r_e_t_his
variable10_case
hurry_up_joe!
ergo_r_e_t_his
c://my_docs/happy_flag_day/12.doc
hurry_up_joe!
spaces
c://my_docs/happy_flag_day/12.doc
_spaces
 
 
Stack empty.</pre>
1,462

edits