TABLE OF CONTENTS


::pwtk::trimIndent

SYNOPSIS

proc ::pwtk::trimIndent {text} {

PURPOSE

Trim indent for each line in the text. Empty lines at the beginning and end of the text are also trimmed.

SOURCE

    set p [set nl {}]
    foreach line [split [string trim $text] \n] {
        append p ${nl}[string trim $line]
        set nl \n
    }
    return $p
}