How to read an entire text file lines into String array with VB.NET

1 Answer

0 votes
Imports System.IO

Module Module1

    Sub Main()

        Dim array As String() = File.ReadAllLines("d:\data.txt")

        For Each line As String In array
            Console.WriteLine(line.Length)
            Console.WriteLine(line)
        Next

    End Sub

End Module

' run:
' 
' 18
' c cpp python cshap
' 8
' java php

 



answered Sep 29, 2018 by avibootz
edited Sep 29, 2018 by avibootz

Related questions

1 answer 326 views
1 answer 236 views
2 answers 289 views
289 views asked Oct 24, 2018 by avibootz
1 answer 266 views
1 answer 256 views
1 answer 232 views
5 answers 457 views
...