www.icetips.com  Icetips Utilities Documentation 6/22/2012    

String Class:  TreatEmptyLastItemAsLine

Previous  Top  Next  


The TreatEmptyLastItemAsLine property is only used in the SplitString method and is used to determine if an empty last item in the array/list should be treated as a line. 

 

Note that the SplitString method is called from StringToLines which in turn is called from FileToLines so you can now determine how SplitString behaves for both those methods by using the TreatEmptyLastItemAsLine property.

 

Consider this string for example:

 

'Arnor|Baldvinsson|'

 

Should that last item be treated as an empty line or as a non-existing line?  The answer can be yes - or no, depending on the way you need this to work!  For some purposes this must be three lines, while for other it must be only two lines.  With the TreatEmptyLastItemAsLine property you can determine if it should create an empty line or not. 

 

This code:

 

ITS  ITStringClass

St   CString(1024)

Code

ITS.TreatEmptyLastItemAsLine = False

St = 'Arnor|Baldvinsson|'

ITS.SplitString(st,'|')

 

will show only two lines, while:

 

ITS  ITStringClass

St   CString(1024)

Code

ITS.TreatEmptyLastItemAsLine = True

St = 'Arnor|Baldvinsson|'

ITS.SplitString(st,'|')

 

will show three lines, where the last one is empty.

 

It is declared as:

 

TreatEmptyLastItemAsLine   Byte

 

Added on June 22, 2012



Direct link to this page: http://www.icetips.com/manuals/utilities/treatemptylastitemasline_stringclass.htm