Strip control codes and extended characters from a string: Difference between revisions
Strip control codes and extended characters from a string (view source)
Revision as of 04:55, 6 December 2019
, 4 years agoadded langur language example
(a more straightforward method, along with the previous entry.) |
Langurmonkey (talk | contribs) (added langur language example) |
||
Line 1,147:
String = 123abcDEF+-*/ Length = 13
</pre>
=={{header|langur}}==
<lang langur>val .str = "()\x15abcd\uFFEF123!@#$%^&*"
writeln "original : ", .str
writeln "without ctrl chars: ", replace(.str, RE/\p{Cc}/, ZLS)
writeln "print ASCII only : ", replace(.str, re/[^ -~]/, ZLS)</lang>
{{out}}
<pre>original : ()�abcd123!@#$%^&*
without ctrl chars: ()abcd123!@#$%^&*
print ASCII only : ()abcd123!@#$%^&*</pre>
=={{header|Liberty BASIC}}==
|