Hi
Weird, I've just used this as a reply somewhere else too
I had to split a text field into separate substrings as I needed to manipuplate each string separately.
Here's what I used (as I couldn't use an array).
//1. Split the string into substrings at each carriage return - each substring contains a single line of the original string.
//2. Only display the third substring, eg the third line of the original string
//3. replace the line feed at the beginning of this substring with a blank character
//(otherwise detail appears on second line of field)
//4. trim the left most character of the substring, so that it appears at the top of the field.
//Step 4 BEGIN - trim the leftmost character of the second substring you've created
ServiceRequest := trimleft (
//Step 3 BEGIN - replace the line feed at the beginning of the substring with a blank character
Replace (
//Step 1 BEGIN - If there are more than 3 carriage returns (eg 3 lines or more) split the string into substrings
if ubound(split({RFSStepPlusCost.strComments},Chr(13))) >= 3 then
//Step 2 BEGIN & END - only display the third substring
split({RFSStepPlusCost.strComments},Chr(13))[3] else "not recorded"
//Step 1 end
//Step 3 end
, chr(10) ," " )
//Step 4 end
);