TABLE OF CONTENTS


::pwtk::skipEmptyLines

SYNOPSIS

proc ::pwtk::skipEmptyLines {text} {

PURPOSE

Skip all empty-lines in $text.

SOURCE

    set newText "" ; # $text might be an empty string
    set nl      ""
    #foreach line [split [string trim $text] \n] {} t.k. Mon Mar 11 2024
    foreach line [split $text \n] {
        if { ! [regexp {^[ \t]*$} $line]  } {
            append newText ${nl}${line}
            set nl "\n"
        }
    }
    return $newText
}