我将如何得出switch算术结束语的陈述?我都尝试"[][]"和"[[\]]"
set x "]"
switch -glob $x {
"[[\]]" {
puts "MATCH ]"
}
}
Run Code Online (Sandbox Code Playgroud)
您可以使用:
set x "]";
switch -glob $x {
\] {
puts "MATCH ]"
}
}
Run Code Online (Sandbox Code Playgroud)
或比括号更匹配:
set x "foo]bar";
switch -glob $x {
*\]* {
puts "MATCH ]"
}
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
594 次 |
| 最近记录: |