- Home /
Read text file and search for a string
Hello, i never used this in the past, so i apologize. I use this code to write on a text file some variables that i need to save:
File.AppendAllText(Application.dataPath +"/data.txt","My text");
Now i want to read this file, and search on it for a string. I know that i can use File.ReadAllText, but this will read only the first line.
Anyone can help me?
depending on how much data you are saving, it might be better to look at PlayerPrefs.
btw, why do you say that ReadAllText
will only read the first line? maybe that's all you see if you print to the console, but it should be entire file.
Thank you, i found out a way using GetString, and yes, i get the first line with the console
Your answer
Follow this Question
Related Questions
Writing to text files 2 Answers
Writing in text box without selecting it? 1 Answer
How To Update a Specific Line with StreamWriter? 1 Answer
Porting to Windows Store syntax problems 0 Answers
how to get Inputs from touch keyboard... 2 Answers