How to find the next newline character

0
I need to sub-divide a string at line breaks.  The string could be something like this: '{} {Details of Products/Services Supplied:\r\nFiltration Products} {The UK operation is controlled by Zebedee UK} {} ' That's four lines of text in one string. Which Mendix construct can I use, inside a loop, to separate out each of the four lines one-by-one? Maybe I'm just having a brain-fade... and none of the string function calls seem to do this for me. Thx
asked
2 answers
2

You can start by find($String,'}') to find the position of the first ending bracket en then substring($String,0,X) where X is the position you found to parse the first line, then 

find($String,'
')

Should give you the position of the next line and you can start using substring again to keep parsing the lines

 

Edit: With find($String,'
')

 

You should be able to find the position of the next line, this position should give the position of the last character of the previous line. I just tested this with a simple 2 line string. If you substring 0,X where X is the number you find above, you should be able to get the complete first line.

answered
0

Stuart, just a thought - would it be possible to switch the string to an html format so that you can use an explicit <br> line break?  It depends how it is being generated and what you want to use it for next...

answered