テキストリストの複数の要素を 1 つのストリングに結合します。
@Implode(textList:any, sep:string) : string
パラメータ | 説明 |
---|---|
textList | 結合するテキストリスト。 |
sep | ストリング内の要素を分割するためのセパレータ。デフォルトはスペースです。 |
戻り値 | 説明 |
---|---|
string | 実行結果のストリング。 |
function p(stuff) {
print("<<<" + stuff + ">>>");
}
var cities = new Array("Paris", "Berlin", "London", "Moscow");
var citiesString = @Implode(cities);
p(citiesString); // <<<Paris Berlin London Moscow>>>
以下の例では、カンマとスペースを要素のセパレータとして使用し、テキストリストを結合しています。
function p(stuff) {
print("<<<" + stuff + ">>>");
}
var cities = new Array("Paris", "Berlin", "London", "Moscow");
var citiesString = @Implode(cities, ", ");
p(citiesString); // <<<Paris, Berlin, London, Moscow>>>