|
Previous Top Next |
Prototype: | (String pS, String pDelimiter, BYTE pDelimiterStartsLine=FALSE),Long,PROC |
pS | String to split |
pDelimiter | Delimiter to use to split the string |
pDelimiterStartsLine | Indicates that the delimiter is the start of the line, not end of it. Defaults to FALSE. 2015-06-23 |
Returns | Number of lines created from the split string |
This method is primarily used to split a string containing linebreaks into a queue of lines. But it can also be used to separate text based on other delimiters.
Example:
ITS ITStringClass
S String(1024)
I Long
Code
S = 'Icetips Creative, Inc.<13,10>136 E. 8th Street<13,10>Port Angeles, WA 98362'
ITS.SplitString(S,'<13,10>)
Loop I = 1 To Records(ITS.Lines)
Message('Line ' & I & ITS.GetLine(I))
End
! Example showing where a delimiter starts the line
S ='SVM2,"1","1"' &|
'SVM2,"1","2"' &|
'SVM2,"1","2"'
ITS.SplitString(S,'SVM2',TRUE)
ITS.ODS('Lines: ' & Records(ITS.Lines))
Loop I = 1 To Records(ITS.Lines)
Get(ITS.Lines,I)
ITS.ODS('Line ' & Format(I,@n02) & ' ' & ITS.Lines.OL)
End
This would show 3 records in the ITS.Lines queue.
See also: