Click here to Skip to main content
Click here to Skip to main content
Alternative Tip

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

By , 23 Jul 2011
Rate this:
Please Sign up or sign in to vote.

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)


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

About the Author

Prerak Patel
Software Developer
India India
Working since 2006 on VBA, VB6, VB.Net, C#, ASP.Net, MSSQL

  • The fear of suffering is worse than the suffering itself.
  • People need not fear the unknown if they are capable of achieving what they need and want.
  • Every blessing ignored becomes a curse.
  • Sometimes what's in your head isn't as crazy as you think.
  • We never really grow up, we only learn how to act in public.
  • You can make very bad teams with very good individuals.
  • Admitting mistakes means you have a sense of responsibility in your actions and that shows you are more matured than almost anyone. -Nithin

Comments and Discussions

Generalthough your solutions is good, however it actually calling w... PinmemberThatsAlok26-Jul-11 21:22 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Mobile
Web02 | 2.8.140415.2 | Last Updated 23 Jul 2011
Article Copyright 2011 by Prerak Patel
Everything else Copyright © CodeProject, 1999-2014
Terms of Use
Layout: fixed | fluid