|
|
|
Add/Remove Line Feeds
Added on 2/15/2000
|
From Technote #3151 at Macromedia.com
--remove line feeds
on CRLF2CR source
set dest to ""
repeat while true
set theOffset to offset(numToChar(10), source)
if NOT theOffset then exit repeat
put char 1 to (theOffset - 1) of source after dest
delete char 1 to theOffset of source
end repeat
put source after dest
return dest
end CRLF2CR
--add line feeds
on CR2CRLF source
set dest to ""
repeat while true
set theOffset to offset(numToChar(13), source)
if NOT theOffset then exit repeat
put char 1 to theOffset of source after dest
put numToChar(10) after dest
delete char 1 to theOffset of source
end repeat
put source after dest
return dest
end CR2CRLF
|
|