VOOZH about

URL: https://www.geeksforgeeks.org/go-language/how-to-read-a-file-line-by-line-to-string-in-golang/

⇱ How to Read a File Line by Line to String in Golang? - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

How to Read a File Line by Line to String in Golang?

Last Updated : 22 Jun, 2020
To read a file line by line the bufio package Scanner is used. Let the text file be named as sample.txt and the content inside the file is as follows:
GO Language is a statically compiled programming language, It is an open-source language. It was designed at Google by Rob Pike, Ken Thompson, and Robert Grieserner. It is also known as Golang. Go language is a general-purpose programming language mainly meant for building large scale complex software.
Output: 👁 Read-a-file-line-by-line-to-string-in-Golang
Comment
Article Tags:

Explore