Tags: VB.NET, VB 2008, VB 2010, VB 2012, VB 2013

The following code is used to reverse a word or a sentence:

Public Class Form1
    Dim textToReverse As String
    Dim Letters() As Char
    Private Sub Button1_Click(ByVal sender As System.Object, _
     ByVal e As System.EventArgs) Handles Button1.Click
        textToReverse = TextBox1.Text
        Letters = textToReverse.ToCharArray()
        Dim ReversedText As New String(Letters, 0, Letters.Length)
        TextBox2.Text = ReversedText
    End Sub
End Class

Reverse a string in visual basic .net

Share This

Home | About | Contact | Privacy Policy

Copyright visual-basic-tutorials.com 2018 - All Rights Reserved.