readText
fn
S readText(S = string, R)(auto ref R name) if (isSomeString!S && (isSomeFiniteCharInputRange!R || is(StringTypeOf!R)))Reads and validates (using validate) a text file. S can be an array of any character type. However, no width or endian conversions are performed. So, if the width or endianness of the characters in the given file differ from the width or endianness of the element type of S, then validation will fail.
Parameters
S | the string type of the file |
name | string or range of characters representing the file _name |
Returns
Array of characters read.
Throws
FileException if there is an error reading the file,
UTFException on UTF decoding error.See Also
read for reading a binary file.