Jump to content

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

Line 586:
(funcall 127-operator (char-code ch) 127)))
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>
 
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.