Jump to content

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

PascalABC.NET
m (→‎{{header|Wren}}: Minor tidy)
(PascalABC.NET)
Line 1,692:
ASCII: )z8i9aKNsFwas#bB}PT
</pre>
 
=={{header|PascalABC.NET}}==
<syntaxhighlight lang="delphi">
function StripControlCodes(s: string): string
:= s.Where(c -> c.Code in 32..126).JoinToString;
 
begin
var s := #127'abc'#1#15#31'def'#12;
Print(StripControlCodes(s));
end.
</syntaxhighlight>
{{out}}
<pre>
abcdef
</pre>
 
 
=={{header|Peloton}}==
220

edits

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