How to concisely concatenate strings in Tcl?

前端 未结 3 1641
面向向阳花
面向向阳花 2021-02-05 06:00

I can easily concatenate two variables, foo and bar, as follows in Tcl: \"${foo}${bar}\".

However, if I don\'t want to put an intermediate result into a variable, how ca

3条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-02-05 06:39

    If you are doing this many times, in a loop, or separated by some intermediate code, you might also consider:

    set result ""
    append result [myFoo $arg]
    append result [myBar $arg]
    append result [myBaz $arg]
    

提交回复
热议问题