Skip to content

Instantly share code, notes, and snippets.

@jz5

jz5/FilteredNames.cs

Created Apr 12, 2020
Embed
What would you like to do?
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