the jackol’s den»Blog Archive » Reverse a String in C# - Mikhail Esteves

the jackol’s den»Blog Archive » Reverse a String in C# - Mikhail Esteves: "If you need a function to reverse a string in C#, here it is!

private string ReverseString(string InputStr)
{
char[] Chars = InputStr.ToCharArray();
int Length = InputStr.Length-1;

for (int x=0;x {
Chars[x] ^= Chars[Length];
Chars[Length] ^= Chars[x];
Chars[x] ^= Chars[Length];
}

return new string(Chars);
}"

No comments:

Ramadan - What is it?

  Ramadan is one of the most important and holy months in the Islamic calendar. It is a time of fasting, prayer, and spiritual reflection fo...