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

(PascalABC.NET)
 
Line 1,489:
 
=={{header|langur}}==
<syntaxhighlight lang="langur">val .str = "()\x15abcd\uFFFF123\uBBBB!@#$%^&*\x01"
val str = "()\x15abcd\uFFFF123\uBBBB!@#$%^&*\x01"
 
writeln "original : ", .str
writeln "without ctrl chars: ", replace(.str, RE/\p{Cc}/, "")
writeln "print ASCII only : ", replace(.str, re/[^ -~]/, "")</syntaxhighlight>
</syntaxhighlight>
 
{{out}}
1,007

edits