Syntax: lindex, lrange, linsert, llength, lappend, lsort & lsearch.
Example:
set list1 [list motocycle car bus truck airplane cablecar]
puts $list1
# output: motocycle car bus truck airplane cablecar
puts [lindex $list1 end-2]
# output: truck
puts [lrange $list1 1 3]
# output: car bus truck
puts [linsert $list1 2 taxi]
# output: motocycle car taxi bus truck airplane cablecar
puts [llength $list1]
# output: 6
lappend list1 all, I don't like
puts $list1
# output: motocycle car bus truck airplane cablecar all, I don't like
沒有留言:
張貼留言