3 ms·
I agree. It would be nice if there were analogs to C#'s helper functions: File.ReadAllLines(string) -> string[] File.ReadAllText(string) -> string
by usea 13y ago
I agree. It would be nice if there were analogs to C#'s helper functions:
File.ReadAllLines(string) -> string[]
File.ReadAllText(string) -> string
File.ReadAllBytes(string) -> byte[]
Great abstractions for opening a file, reading the entire thing into memory, and closing it all in a single go. They will even figure out if the string you pass is a relative path or absolute path. Functions like these go a long way to making a language convenient to use.