WordDelimiters: String;
The WordDelimiters property determines a delimiter between words while reading a text file. A space mark is used as default separator.
Sub Main;
Var
File1: IFileInfo;
TextR: ITextReader;
s: String;
Begin
File1:=New FileInfo.Attach("c:\New_folder\1.txt");
If File1.Exists Then
TextR:=File1.OpenTextReader;
TextR.WordDelimiters:="_";
s:=TextR.ReadWord;
End If;
Dispose File1;
End Sub Main;
After executing this example, the first word read from the text file 1.txt is contained in the "s" variable. A character "_" is used as a separator.
See also: