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

(promoted to task)
Line 125:
---------
=CG(x 4|)9j)<~-vPQFh"[dq#p</pre>
 
=={{header|Python}}==
<lang Python>def stripped(x):
return "".join([i for i in x if ord(i) in range(32, 126)])
 
print stripped("\ba\x00b\n\rc\fd\xc3")</lang>Output:<lang>abcd</lang>
 
=={{header|Tcl}}==
Anonymous user