0

Hi,

The code shown below sucessfully saves text onto a line in a txt document, but using the array, I want to be able to save each piece of text on a separate line. How would I do this?

Thanks in advance :)

Dim filePath As String
Dim objectWriter As StreamWriter
Dim text(3) As String
Dim int As Integer

Sub Main()

    filePath = "C:\College.txt"
    objectWriter = New StreamWriter(filePath)



    For int = 0 To 3
        Console.Write("Enter something here: ")
        text(int) = Console.ReadLine


        objectWriter.Write(text(int))


    Next
    objectWriter.Close()
    Console.WriteLine("Text has been saved.")

        Console.ReadLine()

End Sub
2
Contributors
2
Replies
5
Views
5 Years
Discussion Span
Last Post by collin_ola
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.