Created
March 2, 2021 09:31
-
-
Save syron/1826bb431e9c0c12b2b682403c546df3 to your computer and use it in GitHub Desktop.
This file contains 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
List<string> names = new List<string>() | |
{ | |
"Robert", | |
"Winston", | |
"Leonard", | |
"Jesko", | |
"Paul", | |
"Christian", | |
"Ellie", | |
"Solveig", | |
"Stina", | |
"Emilio" | |
}; | |
foreach (var name in names) | |
{ | |
var reversedName = name.Reverse(); | |
reversedName = string.Join(string.Empty, reversedName); | |
Console.WriteLine(reversedName); | |
} | |
names.ForEach(name => string.Join(string.Empty, name.Reverse())); | |
names.ForEach(n => new string(n.Reverse().ToArray())); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment