Anonymous user
Strip control codes and extended characters from a string: Difference between revisions
Strip control codes and extended characters from a string (view source)
Revision as of 16:55, 25 June 2020
, 3 years ago→{{header|Common Lisp}}: Better implementation
Thundergnat (talk | contribs) (Rename Perl 6 -> Raku, alphabetize, minor clean-up) |
(→{{header|Common Lisp}}: Better implementation) |
||
Line 579:
=={{header|Common Lisp}}==
<pre>
(defun control-char-p (ch)
(= (char-code ch) 127)))
(defun extended-char-p (ch)
(> (char-code ch) 127))
(remove-if #'(lambda (c) ▼
▲ (let ((x (char-code c)))
(or (< x 32) (= x 127))))▼
*extended-ascii*))▼
(defun strip-special-chars (string &key strip-extended)
(let ((needs-removing-p (if strip-extended
(or (control-char-p ch)
</pre>
=={{header|D}}==
|