Skip to content

Instantly share code, notes, and snippets.

@forensicmike
Created March 6, 2020 16:11
Show Gist options
  • Select an option

  • Save forensicmike/c1d63a775fea02a36929d279fc63a672 to your computer and use it in GitHub Desktop.

Select an option

Save forensicmike/c1d63a775fea02a36929d279fc63a672 to your computer and use it in GitHub Desktop.
Isogram by Emma Bostian ported to C#
static public class StringHelpers {
static public bool IsIsogram(this string input) {
var tmp = input.ToLower().ToCharArray();
var hs = new HashSet<char>(tmp);
return hs.Count == tmp.Length;
}
}
void Main()
{
"abcdefghijklmnopqrstuvwxyz".IsIsogram().Dump();
"aabcdefghijklmnopqrstuvwxyz".IsIsogram().Dump();
}
@forensicmike
Copy link
Copy Markdown
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment