c# - How do I generate a stream from a string? - Stack Overflow

PHOTO EMBED

Tue Jan 19 2021 22:32:47 GMT+0000 (UTC)

Saved by @alchniyal #cs

public static MemoryStream GenerateStreamFromString(string value)
{
    return new MemoryStream(Encoding.UTF8.GetBytes(value ?? ""));
}
content_copyCOPY

https://stackoverflow.com/questions/1879395/how-do-i-generate-a-stream-from-a-string