To reverse a string in C# or VB.NET you can use the following snippet.
Sample C#
public string Reverse(string input)
{
var arrayInput = input.ToCharArray();
Array.Reverse(arrayInput);
return new string(arrayInput);
}
Sample VB.NET
Public Function Reverse(input As String) As String Dim arrayInput = input.ToCharArray() Array.Reverse(arrayInput) Return New String(arrayInput) End Function
for more informations take a look at the MSDN: Array.Reverse Method (Array)
RT @CodeSnippetsNET: How to reverse a string in C# or http://t.co/85naMTtT4u: http://t.co/TuOtsggCTp #csharp #vb #programming