Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles / Languages / C#4.0

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

5.00/5 (1 vote)
23 Jul 2011CPOL 12.4K  
What is new in this age old method? We can use LINQ too.Dim inputString As String = Reverse meDim 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.


VB
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)

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)