[Overview][Constants][Types][Procedures and functions][Index] Reference for unit 'LazStringUtils' (#lazutils)

LoadStringFromFile

Reads a string with the contents of the specified file name.

Declaration

Source position: lazstringutils.pas line 111

function LoadStringFromFile(

  const aFileName: string

):string;

Arguments

aFileName

  

Qualified file name with the string value read in the routine.

Function result

String with content read from the specified file name.

Description

LoadStringFromFile creates a TFileStream instance used to load the values from the file name in AFileName. The stream is created with the fmOpenREad file mode, and its Read method is called to read the contents of the entire file stream.

The return values is a String type with the values read from the stream, and its size matches the size of the file stream. If the file stream has no content, the return value is an empty string ('').

Use SaveStringToFile to store a string to a specified file name.

Version info

Added in LazUtils version 4.0.

See also

SaveStringToFile

  

Writes the specified string value to the specified file name.

TFileStream


Version 4.0 Generated 2025-05-03 Home