Strip control codes and extended characters from a string: Difference between revisions
Content added Content deleted
(Added Frink) |
No edit summary |
||
Line 2,286: | Line 2,286: | ||
ab�cd�ef�gh�€ = abcdefgh€ |
ab�cd�ef�gh�€ = abcdefgh€ |
||
ab�cd�ef�gh�ij†klð€ = abcdefghijkl |
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> |
</pre> |
||