Create string t from string s, keeping only ASCII characters
string t = Regex.Replace(s, @"[^\u0000-\u007F]+", string.Empty);
import std.array; import std.algorithm.iteration; import std.ascii;
auto t = s.filter!(a => a.isASCII).array;
import "regexp"
re := regexp.MustCompile("[[:^ascii:]]") t := re.ReplaceAllLiteralString(s, "")
var i: integer; begin t := ''; for i := 1 to length(s) do if s[i] < #128 then t := t + s[i]; end.
uses RegExpr;
var s,t: string; begin t := ReplaceRegExpr('[^\u0000-\u007F]+', s, '', False); end.
import re
t = re.sub('[^\u0000-\u007f]', '', s)
t = s.gsub(/[^[:ascii:]]/, "")
t = s.gsub(/[[:^ascii:]]/, "")
No security, no password. Other people might choose the same nickname.