Notifications
Clear all

[Closed] Detect new line in string?

I know I can add a new line to a string by adding “
” to the string.

But the resulting string contains a carriage return/line feed character, rather than “

So how do I take a string that contains more than one line, and by examining each character in it, determine where the new lines begin?

edit: damn, posted this too soon. I figured out that if I convert each character to an int using bit.charasint, carriage returns have a unique value that I can use to identify them with.

1 Reply

if i get it, that may helps –

ss = Our_String as StringStream
newLinesPos = #(0)
while not eof ss do
(
	skipToNextLine ss
	append newLinesPos (filePos ss)
)
free ss