using System; namespace System { extension String { public void Reverse() { int i = 0; int j = mLength - 1; while (i < j) { Swap!(Ptr[i++], Ptr[j--]); } } } } namespace StringReverse { class Program { static void Main() { String s = scope .("abcdef"); s.Reverse(); Console.WriteLine(s); } } }