Skip to content

Instantly share code, notes, and snippets.

@jz5
Created April 12, 2020 15:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jz5/3bcd5e1d1088b013834ed2a3779a272d to your computer and use it in GitHub Desktop.
Save jz5/3bcd5e1d1088b013834ed2a3779a272d to your computer and use it in GitHub Desktop.
var path = @"日本語の姓.txt";
var names = File.ReadAllLines(path).Where(x => x.Trim() != "").ToList();
var filteredNames = names
.Select(x => Regex.Replace(x, @"\(.+\)", "").Replace(" ", ""))
.Where(x => x.All(y => charHashSet.Contains(y)))
.ToList();
Console.WriteLine($"{filteredNames.Count}件");
Console.WriteLine(string.Join(",", filteredNames));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment