mercredi 1 octobre 2014

Replace a line in text file Golang


Vote count:

0




How do I replace a line in a text file with a new line?


Assume I've opened the file and have every line in an array of string objects i'm now looping through



//find line with ']'
for i, line := range lines {

if strings.Contains(line, ']') {


//replace line with "LOL"
?
}
}


asked 1 min ago







Replace a line in text file Golang

Aucun commentaire:

Enregistrer un commentaire