Skip to content

lisp-case and similar fns ignore special characters #22

@danielhvs

Description

@danielhvs
  1. It seems split-words fn does not consider special chars so they get removed from the string.
    The effect is that lisp-case fn and similar (snake-case etc) ignores the special chars, like ?, ! etc, that are commonly used in clojure keywords.

Current results

(str/lisp-case "abcAbc?abc")
; "abc-abc-abc"
(str/lisp-case "abcAbc!")
; "abc-abc"
(str/lisp-case "abcAbc*abc")
; "abc-abc-abc"

Expected result IMHO:

(str/lisp-case "abcAbc?abc")
; "abc-abc?abc"
(str/lisp-case "abcAbc!")
; "abc-abc!"
(str/lisp-case "abcAbc*abc")
; "abc-abc*abc"
  1. I've found that we might have a similar problem when there is a number in the string.

Actual

(str/lisp-case "123Abc")
; "123abc"

Expected

(str/lisp-case "123Abc")
; "123-abc"

But this works currently:

(str/lisp-case "123aBc")
"123a-bc"

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions