Strip control codes and extended characters from a string: Difference between revisions

Content added Content deleted
Line 586: Line 586:
(funcall 127-operator (char-code ch) 127)))
(funcall 127-operator (char-code ch) 127)))
string)))
string)))

(defvar *the-string* (coerce '(#\H #\e #\l #\l #\o #\Page #\W #\ø #\r #\l #\d) 'string))

(format t "Without controls: ~a~%" (strip-special-chars *the-string*))
(format t "Without extended characters: ~a~%" (strip-special-chars *the-string* :strip-extended t))
</pre>

Output:

<pre>
Without controls: HelloWørld
Without extended chars: HelloWrld
</pre>
</pre>