用户工具

站点工具


语法:tcl语法速查

差别

这里会显示出您选择的修订版和当前版本之间的差别。

到此差别页面的链接

两侧同时换到之前的修订记录前一修订版
后一修订版
前一修订版
语法:tcl语法速查 [2025/02/18 14:57] – [tcl语法速查] user01语法:tcl语法速查 [2025/05/08 10:42] (当前版本) – [8.7 生成连续数字list] user01
行 377: 行 377:
 Returns string repeated count number of times. Returns string repeated count number of times.
  
-==== - string toupper ==== +==== - string 大小写转换 ==== 
-转大写+**转大写** 
 <code> <code>
 string toupper string ?first? ?last? string toupper string ?first? ?last?
 </code> </code>
  
-==== - string tolower ==== +**转小写**
-转小写+
 <code> <code>
 string tolower string ?first? ?last? string tolower string ?first? ?last?
 </code> </code>
 +
  
 ===== - 布尔值 ===== ===== - 布尔值 =====
行 898: 行 899:
  
  
 +==== - 生成连续数字list ====
 +tcl语言并没有原生类似perl 1..10产生10个连续数字的语法,可以使用类似以下proc的方式产生。
 +
 +<code tcl>
 +proc range {start end} {
 +    set list {}
 +    for {set i $start} {$i <= $end} {incr i} {
 +        lappend list $i
 +    }
 +    return $list
 +}
 +set numbers [range 1 10]  ;# 生成 1 到 10 的列表
 +</code>
  
  
语法/tcl语法速查.1739861842.txt.gz · 最后更改: 2025/02/18 14:57 由 user01

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki