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

Content added Content deleted
m (→‎{{header|Phix}}: syntax coloured, made p2js compatible-ish, plus notes)
(Added Frink)
Line 1,005: Line 1,005:
Ext chars stripped Length => 25
Ext chars stripped Length => 25
Both sets stripped Length => 19
Both sets stripped Length => 19
</pre>

=={{header|Frink}}==
<lang frink>stripExtended[str] := str =~ %s/[^\u0020-\u007e]//g

stripControl[str] := str =~ %s/[\u0000-\u001F\u007f]//g

println[stripExtended[char[0 to 127]]]
println[stripControl[char[0 to 127]]]</lang>
{{out}}
<pre>
!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~
!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~
</pre>
</pre>