Check for the condition of anagram
string copy_S1 = S1 , copy_S2 = S2 ; char [ ] t1 = copy_S1 . ToCharArray ( ) ; char [ ] t2 = copy_S2 . ToCharArray ( ) ; Array . Sort ( t1 ) ; Array . Sort ( t2 ) ; copy_S1 = new string ( t1 ) ; copy_S2 = new string ( t2 ) ; if ( copy_S1 != copy_S2 ) { return false ; }