From f50e97a59ea992e5475449763177690b4005506b Mon Sep 17 00:00:00 2001 From: Boutade Date: Sat, 28 Sep 2019 22:45:43 -0500 Subject: added readable-username function --- utils.lisp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'utils.lisp') diff --git a/utils.lisp b/utils.lisp index 691685f..d0dfbd0 100644 --- a/utils.lisp +++ b/utils.lisp @@ -2,3 +2,10 @@ (defun string->json-key (s) (read-from-string (format nil ":|~a|" s))) + +(defun readable-username (s) + (let ((stop-index (search ":" s))) + (if (and stop-index + (equal #\@ (aref s 0))) + (subseq s 1 stop-index) + s))) -- cgit v1.2.3