Strip control codes and extended characters from a string: Difference between revisions
Content deleted Content added
m spelling corrections |
|||
Line 274:
/* check a character
return 1 for true
0 for false
Line 280:
int ascii (const unsigned char c)
{
unsigned char min = 32; /* <space> */
unsigned char max = 126; /* ~ tilde */
if ( c>=min && c<=max ) return 1;
Line 289:
/* check
return 1 for true
0 for false
Line 295:
int ascii_ext (const unsigned char c)
{
unsigned char min_ext = 128;
unsigned char max_ext = 255;
Line 305:
/* fill buffer
then rewrite string from buffer
limit to n < MAX chars
Line 580:
=={{header|Common Lisp}}==
<pre>
(defun
(
(or (< (char-code ch) 32)▼
(funcall 127-operator (char-code ch) 127)))▼
(defun extended-char-p (ch)
(> (char-code ch) 127))
(
(lambda (ch)
#'control-char-p)))
(remove-if needs-removing-p string)))
</pre>
|