function FileToString(FileName: string): string;


This function returns the entire contents of the specified (text) file into a string type variable.




The full path of the text file you want to read. Ex: 'C:\Files\MyDoc.txt'


Return value


A string containing the entire contents of the file.



This function could be very memory-intensive, thus it does not support large files (over 2GB). But of course we recommend to use it only on very small files (few KiloBytes). It's recommended to check the file size using the FileSize function prior to calling this function.