Created
March 6, 2020 16:11
-
-
Save forensicmike/c1d63a775fea02a36929d279fc63a672 to your computer and use it in GitHub Desktop.
Isogram by Emma Bostian ported to C#
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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(); | |
| } | |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
See https://gist.github.com/emmabostian/305970938c972c7b1284654a7234967e for the original JS version