How to check if a variable is empty in tcl
How can you if the variable is empty? It can contain "\n"
either spaces. I am currently doing this
if {{string trimleft $var} != ""} {
# the variable is not empty
puts $var
}
However, the printed variable still appears to be empty? will trimleft
delete "\n"
? Is there a better way to check if a string is empty?
+3
source to share