How to make a save state for a list

I’m trying to make a thing where you click a button, and it generates a sentence from a list of strings. Currently, I have a RemoveAt() so that the list does not repeat:

public void RevealPrompt()
{
    if (entries.Count.Equals(0))
    {
        generate.SetActive(false);
        entryText.text = "You have read all messages.";
        Debug.Log("List empty.");
    }

    int index = Random.Range(0, entries.Count);
    string randomPrompt = entries[index];

    entryText.text = randomPrompt;
    entries.RemoveAt(index);
}

This works okay since I only have 5 sentences that I use for testing, but the actual thing will have way more. As such, I would really like it if I can save the list after each generation, so that when the game is reloaded, the prompts that were already removed remain gone until the player gets to read all the sentences in the list and they get the “You have read all messages”.

I’m sure this would probably involve a Save Manager of some kind, but I’m not sure how to go about it. Any help would be appreciated!

If you want to make changes persistent after closing the application, you will need to save your data to a file. In your case, you can have a file with one line per sentence. At the beginning of the application you load all the sentences on the file, and at the end of the application you save the remaining sentences to the file.

If you want to be sure that your state is saved even when the application closes with an error, you can remove one line of the file each time the user reads a message.

If your sentences contain newlines, you can replace them with \n before saving the file, so in the file you always have one line per message.