' Reverse1 Example ' Read a string from an input file and write ' the reversed string to an output file. Imports System.IO, System.Console Public Module Module1 Public Sub Main() Dim s, t As String Dim i As Integer Dim sr As New StreamReader("Input.txt") If sr.Peek() > -1 Then s = sr.ReadLine() t = "" For i = 0 To s.Length - 1 t = s.Substring(i, 1) & t Next End If Dim sw As New StreamWriter("Reversed.txt") sw.WriteLine(t) ' StreamWriter object must be closed to flush buffer. sw.Close() ReadLine() End Sub End Module