## Tcl9.0.3/Tk9.0.3 Documentation > Tcl Commands > concat

### Tcl/Tk Applications | Tcl Commands | Tk Commands | [incr Tcl] Package Commands | SQLite3 Package Commands | TDBC Package Commands | tdbc::mysql Package Commands | tdbc::odbc Package Commands | tdbc::postgres Package Commands | tdbc::sqlite3 Package Commands | Thread Package Commands | Tcl C API | Tk C API | [incr Tcl] Package C API | TDBC Package C API

### NAME

concat — リストを互いに連結する Join lists together

### 構文 SYNOPSIS

concat ?arg arg ...?

### 説明 DESCRIPTION

この命令は､それぞれの引数からその前後の空白列を取除き､しかる後に､各引数を空白を挟んで連結する｡もし､全ての引数がリストなら､この命令は､それらを一つのリストに連結したものに等しい効果を有す｡ (前後の空白を除去した後)空の引数は完全に無視される｡ いくつの引数があってもよく; 引数が全く与えられないと､結果は空文字列になる｡ 　　　 This command joins each of its arguments together with spaces after trimming leading and trailing white-space from each of them. If all of the arguments are lists, this has the same effect as concatenating them into a single list. Arguments that are empty (after trimming) are ignored entirely. It permits any number of arguments; if no args are supplied, the result is an empty string.

### 用例 EXAMPLES

concat はリストを連結するけれども､処理の間にそれを平準化する(次の対話型利用でその様な例を与える)[訳註 list 命令の用例､及びjoin 命令の用例参照][訳註:eval concat はリスト水準を2つ取除く(https://web.archive.org/web/20170924021758/http://www.interq.or.jp/japan/s-imai/tcltk/list.html 参照)]:　　　　 Although concat will concatenate lists, flattening them in the process (so giving the following interactive session):

    % concat a b {c d e} {f {g h}}
    a b c d e f {g h}

この例で判る様に､この命令はリストでないものも連結する: 　　　 it will also concatenate things that are not lists, as can be seen from this session:

    % concat " a b {c   " d "  e} f"
    a b {c d e} f

註意すべきは､ここで示す例の様に､この連結は値と値の中間にある空白は削除しない: 　　　 Note also that the concatenation does not remove spaces from the middle of values, as can be seen here:

    % concat "a   b   c" { d e f }
    a   b   c d e f

(即ち､この a と b と c の間にそれぞれ３つの空白がある)｡ 　　　 (i.e., there are three spaces between each of the a, the b and the c).

真のリスト連結には､それぞれの入力リストの展開に list 命令を使うべき｡ For true list concatenation, the list command should be used with expansion of each input list:

    % list {*}"a   b   c" {*}{ d e f }
    a b c d e f

### SEE ALSO

append, eval, join, list

### KEYWORDS

concatenate, join, list
Copyright © 1993 The Regents of the University of California.
Copyright © 1994-1996 Sun Microsystems, Inc.