i have a text file that contains words.. how would i get each line and pass it to a variable.

here how it goes:
string variable where each line will be passed and for each line will be passed to a function