Implementation
Pascal

Be concise.

Be useful.

All contributions dictatorially edited by webmasters to match personal tastes.

Please do not paste any copyright violating resource.

Please try to avoid dependencies to third-party libraries and frameworks.

Other implementations
string t = Regex.Replace(s, @"[^\u0000-\u007F]+", string.Empty);
var
  i: integer;
begin
  t := '';
  for i := 1 to length(s) do
    if s[i] < #128 then t := t + s[i];
end.
t = s.gsub(/[^[:ascii:]]/, "")
import "regexp"
re := regexp.MustCompile("[[:^ascii:]]")
t := re.ReplaceAllLiteralString(s, "")
t = s.gsub(/[[:^ascii:]]/, "")
import std.array;
import std.algorithm.iteration;
import std.ascii;
auto t = s.filter!(a => a.isASCII).array;
import re
t = re.sub('[^\u0000-\u007f]', '',  s)
import Data.Char
f = filter isAscii
t = f s
import Data.Char
t = filter isAscii s
let t = s.replace(|c: char| !c.is_ascii(), "");
$t = preg_replace('/[^[:ascii:]]/', '', $s);