Posted By

rtipton on 11/01/09


Tagged

String reverse stringbuilder


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

D4RKCODE


Reverse String


 / Published in: VB.NET
 

  1. Module RevString
  2.  
  3. Sub Main()
  4. Dim inputString As String = Console.ReadLine()
  5. ReverseOrder(inputString)
  6. End Sub
  7.  
  8. Private Sub ReverseOrder(ByVal textInput As String)
  9. Dim text2Rev As String = textInput
  10. Dim reversed As String
  11.  
  12. Dim charArray() As Char = textInput.ToCharArray()
  13. Array.Reverse(charArray)
  14. reversed = charArray
  15.  
  16. Console.WriteLine("")
  17. Console.WriteLine("Original Text: " + text2Rev)
  18. Console.WriteLine("Reversed Text: " + reversed)
  19. End Sub
  20.  
  21. End Module

Report this snippet  

You need to login to post a comment.