ASP.NET 3.5

In this blog you will find ASP.NET 3.5 articles and some code samples. These code samples are created by me and should be working. Thanks for visiting my blog! Happy Dot Netting

Wednesday, November 18, 2009

Program to reverse a string in VB

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim String1 As String
Dim String2 As String
Dim NextChar As String
String2 = ""
String1 = "abcdefgh"
MsgBox(Len(String1))
For i = Len(String1) To 1 Step -1
NextChar = Mid(String1, i, 1)
String2 = String2 & NextChar
Next
MsgBox(String2)
End Sub