Strip control codes and extended characters from a string: Difference between revisions
Content deleted Content added
PascalABC.NET |
Langurmonkey (talk | contribs) |
||
Line 1,489: | Line 1,489: | ||
=={{header|langur}}== |
=={{header|langur}}== |
||
<syntaxhighlight lang="langur"> |
<syntaxhighlight lang="langur"> |
||
val str = "()\x15abcd\uFFFF123\uBBBB!@#$%^&*\x01" |
|||
writeln "original : ", |
writeln "original : ", str |
||
writeln "without ctrl chars: ", replace( |
writeln "without ctrl chars: ", replace(str, RE/\p{Cc}/, "") |
||
writeln "print ASCII only : ", replace( |
writeln "print ASCII only : ", replace(str, re/[^ -~]/, "") |
||
</syntaxhighlight> |
|||
{{out}} |
{{out}} |