Pot.Struct.implode

{String} Pot.Struct.implode ({Object} object [, {String} delimiter = ':' [, {String} separator = ',' [, {Boolean|String} tail = false]]])

Pot.js で利用可能。 PotLite.js では利用できません。

オブジェクトをデリミタとセパレータで連結し文字列にして取得します。

引数 object は連結するオブジェクトを指定します。
引数 delimiter は、キーと値を連結する文字を指定します。デフォルトは ':' です。
引数 separator は、要素と次の要素を連結する文字を指定します。デフォルトは ',' です。
引数 tail を 真 (true) として指定すると、結果の末尾に separator が付きます。
tail を文字列で指定すると、tail そのものが結果の末尾に付きます。
この関数の引数の順序は定義と違っていても動きます。

Pot.globalize() が適応されている場合、Pot.implode() が implode() で実行できます。

object を delimiter と separator で連結した文字列が返ります。

Pot.debug(Pot.implode({color: 'blue', margin: '5px'}, ':', ';', true));
// 'color:blue;margin:5px;'
// Arguments can passed in any order.
// (The first will be the `delimiter` as a string).
Pot.debug(Pot.implode('+', {a: 1, b: 2, c: 3}, '*'));
// 'a+1*b+2*c+3'
// If the `tail` is given as string
//  then will be append the `tail` itself to string.
Pot.debug(Pot.implode('>>', {a: 1, b: 2, c: 3}, '^', '==?'));
// 'a>>1^b>>2^c>>3==?'