public string ModifyFirstWordToAnalyze()
 {
     return(string.Join("",
                        FirstWord
                        .Replace(" ", "")
                        .ToLower()
                        .ToArray()
                        .OrderBy(letter => letter)
                        ));
 }
Example #2
0
        public bool IsAnagram()
        {
            if (FirstWord.Length != SecondWord.Length)
            {
                return(false);
            }
            else
            {
                Char[] firstStringArray  = FirstWord.Replace(" ", "").ToLower().ToCharArray();
                Char[] secondStringArray = SecondWord.Replace(" ", "").ToLower().ToCharArray();

                var result = firstStringArray.Except(secondStringArray);
                if (result.Count() == 0)
                {
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
        }