Strip control codes and extended characters from a string
Arturo
<lang rebol>str: ---string of ☺☻♥♦⌂, may include control characters and other ♫☼§►↔◄░▒▓█┌┴┐±÷²¬└┬┘ilk.---
print "with extended characters" print join select split str 'x ->
not? in? to :integer to :char x (0..31)++127
print "without extended characters" print join select split str 'x ->
and? ascii? x not? in? to :integer to :char x (0..31)++127</lang>
- Output:
with extended characters string of ☺☻♥♦⌂, may include control characters and other ♫☼§►↔◄░▒▓█┌┴┐±÷²¬└┬┘ilk. without extended characters string of , may include control characters and other ilk.