Advertisement
Guest User

Untitled

a guest
May 7th, 2018
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lisp 0.36 KB | None | 0 0
  1. (defun to-camel-case (string)
  2.   (cl-ppcre:regex-replace
  3.    "([a-z])[_-]([a-z])"
  4.    (string-downcase string)
  5.    (lambda (TARGET-STRING START END MATCH-START MATCH-END REG-STARTS REG-ENDS)
  6.      (declare (ignore START END REG-STARTS REG-ENDS))
  7.      (format nil "~C~C" (aref target-string match-start)
  8.              (char-upcase (aref target-string (1- match-end)))))))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement