65.9K
CodeProject is changing. Read more.
Home

Reverse of a string without using the Reverse function in C# and VB

starIconstarIconstarIconstarIconstarIcon

5.00/5 (1 vote)

Jul 23, 2011

CPOL
viewsIcon

12436

What is new in this age old method? We can use LINQ too.Dim inputString As String = "Reverse me"Dim input() As Char = inputString.ToCharArrayDim result As String = New String((From i As Integer In Enumerable.Range(1, input.Length) _ Select...

What is new in this age old method? We can use LINQ too.

Dim inputString As String = "Reverse me"
Dim input() As Char = inputString.ToCharArray
Dim result As String = New String((From i As Integer In Enumerable.Range(1, input.Length) _
                                   Select input(input.Length - i)).ToArray)