Skip to content

Instantly share code, notes, and snippets.

@syron
Created March 2, 2021 09:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save syron/1826bb431e9c0c12b2b682403c546df3 to your computer and use it in GitHub Desktop.
Save syron/1826bb431e9c0c12b2b682403c546df3 to your computer and use it in GitHub Desktop.
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