by shigemk2

当面は技術的なことしか書かない

string-inflection覚え書き

kebabとか忘れそうになる

(string-inflection-underscore-function "EmacsLisp")           ; => "emacs_lisp"
(string-inflection-pascal-case-function "emacs_lisp")         ; => "EmacsLisp"
(string-inflection-camelcase-function "emacs_lisp")           ; => "emacsLisp"
(string-inflection-upcase-function "emacs_lisp")              ; => "EMACS_LISP"
(string-inflection-kebab-case-function "emacs_lisp")          ; => "emacs-lisp"
(string-inflection-capital-underscore-function "emacs_lisp")  ; => "Emacs_Lisp"

(string-inflection-pascal-case-p "EmacsLisp")                 ; => t
(string-inflection-pascal-case-p "emacs_lisp")                ; => nil

github.com