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

Content deleted Content added
Miks1965 (talk | contribs)
PascalABC.NET
Langurmonkey (talk | contribs)
Line 1,489: Line 1,489:


=={{header|langur}}==
=={{header|langur}}==
<syntaxhighlight lang="langur">val .str = "()\x15abcd\uFFFF123\uBBBB!@#$%^&*\x01"
<syntaxhighlight lang="langur">
val str = "()\x15abcd\uFFFF123\uBBBB!@#$%^&*\x01"


writeln "original : ", .str
writeln "original : ", str
writeln "without ctrl chars: ", replace(.str, RE/\p{Cc}/, "")
writeln "without ctrl chars: ", replace(str, RE/\p{Cc}/, "")
writeln "print ASCII only : ", replace(.str, re/[^ -~]/, "")</syntaxhighlight>
writeln "print ASCII only : ", replace(str, re/[^ -~]/, "")
</syntaxhighlight>


{{out}}
{{out}}