Simple coding assignment: Take text from a textbox and flip it so it's backwords:
i.e. Hello My Name Is David would be "divad si eman ym olleh" ( The program doesn't have to match case, just the letters)
This is something I found, do you have any other methods?
Dim str As String = Textbox1.Text
Dim arr As New List(Of Char)
arr.AddRange(str.ToCharArray)
arr.Reverse()
For Each l As Char In arr
lblOne.Text &= l
Next
You can do it in one line with using the StrReverse
function (in Microsoft.VisualBasic).
Dim myText As String = "My Name is Dave"
Dim revText As String = StrReverse(myText)
Quick one liner.
lblOne.Text = String.Join("", "divad si eman ym olleh".Reverse())
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With