Reverse boy results yob

how to revers in c#
2 Replies
hercules_x_x
hercules_x_xOP3y ago
System.Console.Write("PLease enter your word :"); string pass1=Console.ReadLine(); Console.WriteLine("{0,-5}",pass1);
Olivier Bélanger
@Hercules_x_x You can create a function that convert your string to an array of char and then reverse your array:
static string Reverse(string input)
{
char[] chars = input.ToCharArray();
Array.Reverse(chars);
return new string(chars);
}
static string Reverse(string input)
{
char[] chars = input.ToCharArray();
Array.Reverse(chars);
return new string(chars);
}
Want results from more Discord servers?
Add your server