I have a txt file that includes :
Hello Word
myStrings = [str1, str2, str3]
Goodbye Word
I would like to read the file to find the "myStrings" string then have a loop to check if one of the myStrings value [str1, str2, str3] match with a some variable.
Currently I am finding the myStrings like this:
Scanner scanner = new Scanner(fileName);
while (scanner.hasNextLine()) {
String fileline = scanner.nextLine();
String myStringsKey = "myStrings =";
if(fileline.startsWith(myStringsKey)) {
}
}
How can I achieve str2 for instance to check with a defined var? I assume I should use "split".