Search This Blog

TCL: get the last or first element in a list

The following example shows how to get the last and first element of a list in TCL:

2 comments:

  1. What about ?

    puts [lindex $mylist end]

    ReplyDelete
    Replies
    1. Good catch. I did not know "end" can be used.

      Thanks.

      Delete