Option Strict On Option Explicit On Public Class frmMain 'Click calls the ReverseWord Function Private Sub btnReverse_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnReverse.Click txtReversed.Text = ReverseWord(txtWord.Text) End Sub 'Name: ReverseWord 'Parameters: word - word to be reversed (ByVal String) 'Returns: reversed word (String) 'Description: Takes in a word as a parameter and returns the word backwards Function ReverseWord(ByVal word As String) As String Dim m As Integer, temp As String = "" 'm is set to the length of the word m = word.Length 'iterates through the word backwards and adds letters to the temporary string For i As Integer = m - 1 To 0 Step -1 temp &= word.Substring(i, 1) Next Return temp End Function End Class