'How can I put a txt file (that is in a zip file) in a string, without extracting the zip?

Here is my code:

using (ZipArchive zip = ZipFile.Open(path, ZipArchiveMode.Read))
    foreach (ZipArchiveEntry entry in zip.Entries)
        if (entry.Name == "example.txt")
            entry.ExtractToFile(???);

The ??? is what I'm having trouble with. I want it to go to a string, not a file on disk.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source