Jump to content

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

no edit summary
(Added Frink)
No edit summary
Line 2,286:
ab�cd�ef�gh�€ = abcdefgh€
ab�cd�ef�gh�ij†klð€ = abcdefghijkl
</pre>
 
=={{header|Vlang}}==
{{trans|AutoHotkey}}
<lang vlang>fn main() {
println(stripped("\ba\x00b\n\rc\fd\xc3"))
}
 
fn stripped(source string) string {
mut result := ''
for value in source {if value > 31 && value < 128 {result += value.ascii_str()}}
return result
}</lang>
 
{{Out}}
<pre>
abcd
</pre>
 
291

edits

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