if {[string compare $a $b] < 0} { puts "first string lower than second" } if {[string compare $a $b] > 0} { puts "first string higher than second" }