Jump to content

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

Add ed example
(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}}==
90

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.