length(n) Tcl Built-In Commands llength(n)
___________________________________________________________________________
NAME
名称
llength - Count the number of elements in a list
SYNOPSIS
摘要
llength list
______________________________________________________________________________
DESCRIPTION
描述
Treats list as a list and returns a decimal string giving the number of elements in it.
把列表作为一个字符串,并返回一个十进制数表示元素的数量
EXAMPLES
实例
The result is the number of elements:
-
% llength {a b c d e}
-
5
-
% llength {a b c}
-
3
-
% llength {}
-
0
Elements are not guaranteed to be exactly words in a dictionary sense.
of course, especially when quoting is used:
元素不能保证完全是字典里的单词,当然,特别是当使用应用时。
-
% llength {a b {c d} e}
-
4
-
% llength {a b { } c d e}
-
6
An empty list is not necessarily an empty string:
一个空列表不一定是一个空字符串
-
% set var { }; puts "[string length $var],[llength $var]"
-
1,0
阅读(416) | 评论(0) | 转发(0) |