Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
two words are anagrams
//Rextester.Program.Main is the entry point for your code. Don't change it. //Microsoft (R) Visual C# Compiler version 2.9.0.63208 (958f2354) using System; using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; namespace Rextester { public class Program { public static void Main(string[] args) { string str1 = "heater"; string str2 = "reheat"; char[] ch1 = str1.ToLower().ToCharArray(); char[] ch2 = str2.ToLower().ToCharArray(); Array.Sort(ch1); Array.Sort(ch2); string val1 = new string(ch1); string val2 = new string(ch2); if (val1 == val2) { Console.WriteLine("Both the strings are Anagrams"); } else { Console.WriteLine("Both the strings are not Anagrams"); } } } }
run
|
edit
|
history
|
help
0
SimpleHelloworldProgram
Lazy exception caching
Raise Meldings logikk
insertion sort
Static Class
Fibonacci Series
IEqatable simple object compare
005
Sam a,b and c
golestanali