Skip to main content
Code Review

Return to Revisions

2 of 2
deleted 19 characters in body
user avatar
user avatar

There are not much to say other than the usual missing argument null check:

It is valid to write the following:

 string test = null;
 test.RemoveDuplicateChars();

and RemoveDuplicateChars will be called with a null for the this argument text. Therefore you'll have to test for null:

public static string RemoveDuplicateChars(
 this string text, Func<string, string> normalizer = null)
{
 if (text == null)
 return text;
 ...

or throw an exception...


The default initialization of normalizer could be a little less verbose:

 normalizer = normalizer ?? ((x) => x.Normalize());

A minor detail: Angstrom and Å: is also represented by \u00C5, which your code interprets as equal to Angstrom, but MS Word interprets them as different when using its Find-function?

user73941
default

AltStyle によって変換されたページ (->オリジナル) /