Last active
December 14, 2015 11:39
-
-
Save xtman/5081129 to your computer and use it in GitHub Desktop.
The example shows how to get the last and first element of list in TCL.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set mylist "1 2 3 4 5" | |
# prints the last element of mylist: 5 | |
puts [lindex $mylist end] | |
# prints the first element of mylist: 1 | |
puts [lindex $mylist 0] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment