Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
how to remove excess lines
#4
Try this function:
Function TrimMultiBlankLines
Code:
Copy      Help
;Reduce multi blank lines into one blank line only.

function str'text
str line
int emptyLineCount emptyLineExist
out
foreach line text
,line.trim()
,if (len(line) = 0)
,,emptyLineCount +=1
,,emptyLineExist = 1
,,if (emptyLineCount > 1)
,,,emptyLineExist = 0
,else
,,out line
,,emptyLineCount = 0
,if (emptyLineExist )
,,out ""
,,emptyLineExist = 0

Usage: TrimMultiBlankLines [string_text]


Messages In This Thread
how to remove excess lines - by ilcaa - 07-31-2020, 11:00 PM
RE: how to remove excess lines - by Kevin - 08-01-2020, 12:34 AM
RE: how to remove excess lines - by ilcaa - 08-01-2020, 01:20 AM
RE: how to remove excess lines - by Start_Learning - 08-01-2020, 03:51 AM
RE: how to remove excess lines - by Kevin - 08-01-2020, 06:51 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)