Answers for "read strinf file go"

C++
1

go read file to string

// go read file to string
b, err := ioutil.ReadFile("file.txt") // just pass the file name
    if err != nil {
        fmt.Print(err)
    }
str := string(b) // convert content to a 'string'
Posted by: Guest on December-07-2021

Browse Popular Code Answers by Language