This commit is contained in:
1 parent
45b7a2b7e6
commit
960d52686a
8 files changed
+98
-51
No files matched your search
@@ -16,7 +16,8 @@ public static class UntisNameMatching
|
||||
!string.IsNullOrWhiteSpace(a) && !string.IsNullOrWhiteSpace(b) && NameKey(a) == NameKey(b);
|
||||
|
||||
public static string NameKey(string value) => string.Join(' ',
|
||||
value.Split(' ', StringSplitOptions.RemoveEmptyEntries)
|
||||
.Select(w => w.Trim().ToLowerInvariant())
|
||||
System.Text.RegularExpressions.Regex.Split(value, @"[^\p{L}\p{Nd}]+")
|
||||
.Where(w => w.Length > 0)
|
||||
.Select(w => w.ToLowerInvariant())
|
||||
.OrderBy(w => w, StringComparer.Ordinal));
|
||||
}
|
||||
Reference in new issue
Block a user