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 01:37, 1 July 2024
, 5 days agoAdd ed example
Langurmonkey (talk | contribs) |
(Add ed example) |
||
Line 887:
print strip "\tHellö world"
</syntaxhighlight>
=={{header|ed}}==
Uses POSIX control character class.
<syntaxhighlight lang="sed">
H
,l
g/.*/s/[[:cntrl:]]//g
,p
Q
</syntaxhighlight>
{{out}}
<pre>$ cat control-chars.ed | ed -lEGs control-chars.input
abc\r
\b\adef\177
abc
def</pre>
=={{header|Erlang}}==
|