ms_learn_csharp/022_array_operations/pangram/Program.cs

14 lines
410 B
C#
Raw Normal View History

2024-07-31 22:38:31 -04:00
string pangram = "The quick brown fox jumps over the lazy dog";
string[] words = pangram.Split(' ');
string[] new_words = new String[words.Length];
int counter = 0;
string new_pangram;
foreach (string word in words) {
char[] temp_chars = word.ToCharArray();
new_words[counter++] = String.Join("", temp_chars.Reverse());
}
new_pangram = String.Join(" ", new_words);
Console.WriteLine(new_pangram);